hotspot/src/share/vm/opto/superword.hpp
changeset 30593 69f942690128
parent 30588 24fc4b3a964e
child 30625 80a08f9b2d63
equal deleted inserted replaced
30592:fa0ae17a543e 30593:69f942690128
     1 /*
     1 /*
     2  * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   216 
   216 
   217   GrowableArray<Node*> _block;           // Nodes in current block
   217   GrowableArray<Node*> _block;           // Nodes in current block
   218   GrowableArray<Node*> _data_entry;      // Nodes with all inputs from outside
   218   GrowableArray<Node*> _data_entry;      // Nodes with all inputs from outside
   219   GrowableArray<Node*> _mem_slice_head;  // Memory slice head nodes
   219   GrowableArray<Node*> _mem_slice_head;  // Memory slice head nodes
   220   GrowableArray<Node*> _mem_slice_tail;  // Memory slice tail nodes
   220   GrowableArray<Node*> _mem_slice_tail;  // Memory slice tail nodes
   221 
   221   GrowableArray<Node*> _iteration_first; // nodes in the generation that has deps from phi
       
   222   GrowableArray<Node*> _iteration_last;  // nodes in the generation that has deps to   phi
   222   GrowableArray<SWNodeInfo> _node_info;  // Info needed per node
   223   GrowableArray<SWNodeInfo> _node_info;  // Info needed per node
       
   224   CloneMap&                 _clone_map;  // map of nodes created in cloning
   223 
   225 
   224   MemNode* _align_to_ref;                // Memory reference that pre-loop will align to
   226   MemNode* _align_to_ref;                // Memory reference that pre-loop will align to
   225 
   227 
   226   GrowableArray<OrderedPair> _disjoint_ptrs; // runtime disambiguated pointer pairs
   228   GrowableArray<OrderedPair> _disjoint_ptrs; // runtime disambiguated pointer pairs
   227 
   229 
   248   IdealLoopTree* _lpt;             // Current loop tree node
   250   IdealLoopTree* _lpt;             // Current loop tree node
   249   LoopNode*      _lp;              // Current LoopNode
   251   LoopNode*      _lp;              // Current LoopNode
   250   Node*          _bb;              // Current basic block
   252   Node*          _bb;              // Current basic block
   251   PhiNode*       _iv;              // Induction var
   253   PhiNode*       _iv;              // Induction var
   252   bool           _race_possible;   // In cases where SDMU is true
   254   bool           _race_possible;   // In cases where SDMU is true
       
   255   bool           _do_vector_loop;  // whether to do vectorization/simd style
       
   256   bool           _vector_loop_debug; // provide more printing in debug mode
   253   int            _num_work_vecs;   // Number of non memory vector operations
   257   int            _num_work_vecs;   // Number of non memory vector operations
   254   int            _num_reductions;  // Number of reduction expressions applied
   258   int            _num_reductions;  // Number of reduction expressions applied
       
   259   int            _ii_first;        // generation with direct deps from mem phi
       
   260   int            _ii_last;         // generation with direct deps to   mem phi
       
   261   GrowableArray<int> _ii_order;
   255 
   262 
   256   // Accessors
   263   // Accessors
   257   Arena* arena()                   { return _arena; }
   264   Arena* arena()                   { return _arena; }
   258 
   265 
   259   Node* bb()                       { return _bb; }
   266   Node* bb()                       { return _bb; }
   324   MemNode* find_align_to_ref(Node_List &memops);
   331   MemNode* find_align_to_ref(Node_List &memops);
   325   // Calculate loop's iv adjustment for this memory ops.
   332   // Calculate loop's iv adjustment for this memory ops.
   326   int get_iv_adjustment(MemNode* mem);
   333   int get_iv_adjustment(MemNode* mem);
   327   // Can the preloop align the reference to position zero in the vector?
   334   // Can the preloop align the reference to position zero in the vector?
   328   bool ref_is_alignable(SWPointer& p);
   335   bool ref_is_alignable(SWPointer& p);
       
   336   // rebuild the graph so all loads in different iterations of cloned loop become dependant on phi node (in _do_vector_loop only)
       
   337   bool hoist_loads_in_graph();
       
   338   // Test whether MemNode::Memory dependency to the same load but in the first iteration of this loop is coming from memory phi
       
   339   // Return false if failed.
       
   340   Node* find_phi_for_mem_dep(LoadNode* ld);
       
   341   // Return same node but from the first generation. Return 0, if not found
       
   342   Node* first_node(Node* nd);
       
   343   // Return same node as this but from the last generation. Return 0, if not found
       
   344   Node* last_node(Node* n);
       
   345   // Mark nodes belonging to first and last generation,
       
   346   // returns first generation index or -1 if vectorization/simd is impossible
       
   347   int mark_generations();
       
   348   // swapping inputs of commutative instruction (Add or Mul)
       
   349   bool fix_commutative_inputs(Node* gold, Node* fix);
       
   350   // make packs forcefully (in _do_vector_loop only)
       
   351   bool pack_parallel();
   329   // Construct dependency graph.
   352   // Construct dependency graph.
   330   void dependence_graph();
   353   void dependence_graph();
   331   // Return a memory slice (node list) in predecessor order starting at "start"
   354   // Return a memory slice (node list) in predecessor order starting at "start"
   332   void mem_slice_preds(Node* start, Node* stop, GrowableArray<Node*> &preds);
   355   void mem_slice_preds(Node* start, Node* stop, GrowableArray<Node*> &preds);
   333   // Can s1 and s2 be in a pack with s1 immediately preceding s2 and  s1 aligned at "align"
   356   // Can s1 and s2 be in a pack with s1 immediately preceding s2 and  s1 aligned at "align"
   417   // Find pre loop end from main loop.  Returns null if none.
   440   // Find pre loop end from main loop.  Returns null if none.
   418   CountedLoopEndNode* get_pre_loop_end(CountedLoopNode *cl);
   441   CountedLoopEndNode* get_pre_loop_end(CountedLoopNode *cl);
   419   // Is the use of d1 in u1 at the same operand position as d2 in u2?
   442   // Is the use of d1 in u1 at the same operand position as d2 in u2?
   420   bool opnd_positions_match(Node* d1, Node* u1, Node* d2, Node* u2);
   443   bool opnd_positions_match(Node* d1, Node* u1, Node* d2, Node* u2);
   421   void init();
   444   void init();
       
   445   // clean up some basic structures - used if the ideal graph was rebuilt
       
   446   void restart();
   422 
   447 
   423   // print methods
   448   // print methods
   424   void print_packset();
   449   void print_packset();
   425   void print_pack(Node_List* p);
   450   void print_pack(Node_List* p);
   426   void print_bb();
   451   void print_bb();