1274 bool intrinsify_fill(IdealLoopTree* lpt);
1275 bool match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& store_value,
1276 Node*& shift, Node*& offset);
1277
1278 private:
1279 // Return a type based on condition control flow
1280 const TypeInt* filtered_type( Node *n, Node* n_ctrl);
1281 const TypeInt* filtered_type( Node *n ) { return filtered_type(n, NULL); }
1282 // Helpers for filtered type
1283 const TypeInt* filtered_type_from_dominators( Node* val, Node *val_ctrl);
1284
1285 // Helper functions
1286 Node *spinup( Node *iff, Node *new_false, Node *new_true, Node *region, Node *phi, small_cache *cache );
1287 Node *find_use_block( Node *use, Node *def, Node *old_false, Node *new_false, Node *old_true, Node *new_true );
1288 void handle_use( Node *use, Node *def, small_cache *cache, Node *region_dom, Node *new_false, Node *new_true, Node *old_false, Node *old_true );
1289 bool split_up( Node *n, Node *blk1, Node *blk2 );
1290 void sink_use( Node *use, Node *post_loop );
1291 Node *place_near_use( Node *useblock ) const;
1292 Node* try_move_store_before_loop(Node* n, Node *n_ctrl);
1293 void try_move_store_after_loop(Node* n);
1294 bool identical_backtoback_ifs(Node *n);
1295 bool can_split_if(Node *n_ctrl);
1296
1297 bool _created_loop_node;
1298 public:
1299 void set_created_loop_node() { _created_loop_node = true; }
1300 bool created_loop_node() { return _created_loop_node; }
1301 void register_new_node( Node *n, Node *blk );
1302
1303 #ifdef ASSERT
1304 void dump_bad_graph(const char* msg, Node* n, Node* early, Node* LCA);
1305 #endif
1306
1307 #ifndef PRODUCT
1308 void dump( ) const;
1309 void dump( IdealLoopTree *loop, uint rpo_idx, Node_List &rpo_list ) const;
1310 void rpo( Node *start, Node_Stack &stk, VectorSet &visited, Node_List &rpo_list ) const;
1311 void verify() const; // Major slow :-)
1312 void verify_compare( Node *n, const PhaseIdealLoop *loop_verify, VectorSet &visited ) const;
1313 IdealLoopTree *get_loop_idx(Node* n) const {
1314 // Dead nodes have no loop, so return the top level loop instead
1315 return _nodes[n->_idx] ? (IdealLoopTree*)_nodes[n->_idx] : _ltree_root;
1316 }
1317 // Print some stats
1318 static void print_statistics();
1319 static int _loop_invokes; // Count of PhaseIdealLoop invokes
1320 static int _loop_work; // Sum of PhaseIdealLoop x _unique
1321 #endif
1322 };
1323
1324 // This kit may be used for making of a reserved copy of a loop before this loop
1325 // goes under non-reversible changes.
1326 //
1327 // Function create_reserve() creates a reserved copy (clone) of the loop.
1328 // The reserved copy is created by calling
1329 // PhaseIdealLoop::create_reserve_version_of_loop - see there how
1330 // the original and reserved loops are connected in the outer graph.
1331 // If create_reserve succeeded, it returns 'true' and _has_reserved is set to 'true'.
1332 //
1333 // By default the reserved copy (clone) of the loop is created as dead code - it is
1334 // dominated in the outer loop by this node chain:
1335 // intcon(1)->If->IfFalse->reserved_copy.
1336 // The original loop is dominated by the the same node chain but IfTrue projection:
1337 // intcon(0)->If->IfTrue->original_loop.
1338 //
1339 // In this implementation of CountedLoopReserveKit the ctor includes create_reserve()
1340 // and the dtor, checks _use_new value.
1341 // If _use_new == false, it "switches" control to reserved copy of the loop
|
1274 bool intrinsify_fill(IdealLoopTree* lpt);
1275 bool match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& store_value,
1276 Node*& shift, Node*& offset);
1277
1278 private:
1279 // Return a type based on condition control flow
1280 const TypeInt* filtered_type( Node *n, Node* n_ctrl);
1281 const TypeInt* filtered_type( Node *n ) { return filtered_type(n, NULL); }
1282 // Helpers for filtered type
1283 const TypeInt* filtered_type_from_dominators( Node* val, Node *val_ctrl);
1284
1285 // Helper functions
1286 Node *spinup( Node *iff, Node *new_false, Node *new_true, Node *region, Node *phi, small_cache *cache );
1287 Node *find_use_block( Node *use, Node *def, Node *old_false, Node *new_false, Node *old_true, Node *new_true );
1288 void handle_use( Node *use, Node *def, small_cache *cache, Node *region_dom, Node *new_false, Node *new_true, Node *old_false, Node *old_true );
1289 bool split_up( Node *n, Node *blk1, Node *blk2 );
1290 void sink_use( Node *use, Node *post_loop );
1291 Node *place_near_use( Node *useblock ) const;
1292 Node* try_move_store_before_loop(Node* n, Node *n_ctrl);
1293 void try_move_store_after_loop(Node* n);
1294 public:
1295 bool identical_backtoback_ifs(Node *n);
1296 bool can_split_if(Node *n_ctrl);
1297 private:
1298
1299 bool _created_loop_node;
1300 public:
1301 void set_created_loop_node() { _created_loop_node = true; }
1302 bool created_loop_node() { return _created_loop_node; }
1303 void register_new_node( Node *n, Node *blk );
1304
1305 #ifdef ASSERT
1306 void dump_bad_graph(const char* msg, Node* n, Node* early, Node* LCA);
1307 #endif
1308
1309 #ifndef PRODUCT
1310 void dump( ) const;
1311 void dump( IdealLoopTree *loop, uint rpo_idx, Node_List &rpo_list ) const;
1312 void verify() const; // Major slow :-)
1313 void verify_compare( Node *n, const PhaseIdealLoop *loop_verify, VectorSet &visited ) const;
1314 IdealLoopTree *get_loop_idx(Node* n) const {
1315 // Dead nodes have no loop, so return the top level loop instead
1316 return _nodes[n->_idx] ? (IdealLoopTree*)_nodes[n->_idx] : _ltree_root;
1317 }
1318 // Print some stats
1319 static void print_statistics();
1320 static int _loop_invokes; // Count of PhaseIdealLoop invokes
1321 static int _loop_work; // Sum of PhaseIdealLoop x _unique
1322 #endif
1323 void rpo( Node *start, Node_Stack &stk, VectorSet &visited, Node_List &rpo_list ) const;
1324
1325 PhaseIterGVN& igvn() { return _igvn; }
1326 };
1327
1328 // This kit may be used for making of a reserved copy of a loop before this loop
1329 // goes under non-reversible changes.
1330 //
1331 // Function create_reserve() creates a reserved copy (clone) of the loop.
1332 // The reserved copy is created by calling
1333 // PhaseIdealLoop::create_reserve_version_of_loop - see there how
1334 // the original and reserved loops are connected in the outer graph.
1335 // If create_reserve succeeded, it returns 'true' and _has_reserved is set to 'true'.
1336 //
1337 // By default the reserved copy (clone) of the loop is created as dead code - it is
1338 // dominated in the outer loop by this node chain:
1339 // intcon(1)->If->IfFalse->reserved_copy.
1340 // The original loop is dominated by the the same node chain but IfTrue projection:
1341 // intcon(0)->If->IfTrue->original_loop.
1342 //
1343 // In this implementation of CountedLoopReserveKit the ctor includes create_reserve()
1344 // and the dtor, checks _use_new value.
1345 // If _use_new == false, it "switches" control to reserved copy of the loop
|