comparison src/share/vm/opto/block.hpp @ 12171:4b078f877b56

8023988: Move local scheduling of nodes to the CFG creation and code motion phase (PhaseCFG) Summary: Moved local scheduling code from class Block to class PhaseCFG Reviewed-by: kvn, roland
author adlertz
date Sun, 01 Sep 2013 19:21:05 +0200
parents 650868c062a9
children de6a9e811145 044b28168e20
comparison
equal deleted inserted replaced
12169:29aa8936f03c 12171:4b078f877b56
316 // Find node in block 316 // Find node in block
317 uint find_node( const Node *n ) const; 317 uint find_node( const Node *n ) const;
318 // Find and remove n from block list 318 // Find and remove n from block list
319 void find_remove( const Node *n ); 319 void find_remove( const Node *n );
320 320
321 // helper function that adds caller save registers to MachProjNode
322 void add_call_kills(MachProjNode *proj, RegMask& regs, const char* save_policy, bool exclude_soe);
323 // Schedule a call next in the block
324 uint sched_call(Matcher &matcher, PhaseCFG* cfg, uint node_cnt, Node_List &worklist, GrowableArray<int> &ready_cnt, MachCallNode *mcall, VectorSet &next_call);
325
326 // Perform basic-block local scheduling
327 Node *select(PhaseCFG *cfg, Node_List &worklist, GrowableArray<int> &ready_cnt, VectorSet &next_call, uint sched_slot);
328 void set_next_call( Node *n, VectorSet &next_call, PhaseCFG* cfg);
329 void needed_for_next_call(Node *this_call, VectorSet &next_call, PhaseCFG* cfg);
330 bool schedule_local(PhaseCFG *cfg, Matcher &m, GrowableArray<int> &ready_cnt, VectorSet &next_call);
331 // Cleanup if any code lands between a Call and his Catch
332 void call_catch_cleanup(PhaseCFG* cfg, Compile *C);
333 // Detect implicit-null-check opportunities. Basically, find NULL checks
334 // with suitable memory ops nearby. Use the memory op to do the NULL check.
335 // I can generate a memory op if there is not one nearby.
336 void implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowed_reasons);
337
338 // Return the empty status of a block 321 // Return the empty status of a block
339 enum { not_empty, empty_with_goto, completely_empty }; 322 enum { not_empty, empty_with_goto, completely_empty };
340 int is_Empty() const; 323 int is_Empty() const;
341 324
342 // Forward through connectors 325 // Forward through connectors
364 } 347 }
365 348
366 // Examine block's code shape to predict if it is not commonly executed. 349 // Examine block's code shape to predict if it is not commonly executed.
367 bool has_uncommon_code() const; 350 bool has_uncommon_code() const;
368 351
369 // Use frequency calculations and code shape to predict if the block
370 // is uncommon.
371 bool is_uncommon(PhaseCFG* cfg) const;
372
373 #ifndef PRODUCT 352 #ifndef PRODUCT
374 // Debugging print of basic block 353 // Debugging print of basic block
375 void dump_bidx(const Block* orig, outputStream* st = tty) const; 354 void dump_bidx(const Block* orig, outputStream* st = tty) const;
376 void dump_pred(const PhaseCFG* cfg, Block* orig, outputStream* st = tty) const; 355 void dump_pred(const PhaseCFG* cfg, Block* orig, outputStream* st = tty) const;
377 void dump_head(const PhaseCFG* cfg, outputStream* st = tty) const; 356 void dump_head(const PhaseCFG* cfg, outputStream* st = tty) const;
450 429
451 // Pick a block between early and late that is a cheaper alternative 430 // Pick a block between early and late that is a cheaper alternative
452 // to late. Helper for schedule_late. 431 // to late. Helper for schedule_late.
453 Block* hoist_to_cheaper_block(Block* LCA, Block* early, Node* self); 432 Block* hoist_to_cheaper_block(Block* LCA, Block* early, Node* self);
454 433
434 bool schedule_local(Block* block, GrowableArray<int>& ready_cnt, VectorSet& next_call);
435 void set_next_call(Block* block, Node* n, VectorSet& next_call);
436 void needed_for_next_call(Block* block, Node* this_call, VectorSet& next_call);
437
438 // Perform basic-block local scheduling
439 Node* select(Block* block, Node_List& worklist, GrowableArray<int>& ready_cnt, VectorSet& next_call, uint sched_slot);
440
441 // Schedule a call next in the block
442 uint sched_call(Block* block, uint node_cnt, Node_List& worklist, GrowableArray<int>& ready_cnt, MachCallNode* mcall, VectorSet& next_call);
443
444 // Cleanup if any code lands between a Call and his Catch
445 void call_catch_cleanup(Block* block);
446
447 Node* catch_cleanup_find_cloned_def(Block* use_blk, Node* def, Block* def_blk, int n_clone_idx);
448 void catch_cleanup_inter_block(Node *use, Block *use_blk, Node *def, Block *def_blk, int n_clone_idx);
449
450 // Detect implicit-null-check opportunities. Basically, find NULL checks
451 // with suitable memory ops nearby. Use the memory op to do the NULL check.
452 // I can generate a memory op if there is not one nearby.
453 void implicit_null_check(Block* block, Node *proj, Node *val, int allowed_reasons);
454
455 // Perform a Depth First Search (DFS). 455 // Perform a Depth First Search (DFS).
456 // Setup 'vertex' as DFS to vertex mapping. 456 // Setup 'vertex' as DFS to vertex mapping.
457 // Setup 'semi' as vertex to DFS mapping. 457 // Setup 'semi' as vertex to DFS mapping.
458 // Set 'parent' to DFS parent. 458 // Set 'parent' to DFS parent.
459 uint do_DFS(Tarjan* tarjan, uint rpo_counter); 459 uint do_DFS(Tarjan* tarjan, uint rpo_counter);
565 565
566 // does this node reside in a block; return true 566 // does this node reside in a block; return true
567 bool has_block(const Node* node) const { 567 bool has_block(const Node* node) const {
568 return (_node_to_block_mapping.lookup(node->_idx) != NULL); 568 return (_node_to_block_mapping.lookup(node->_idx) != NULL);
569 } 569 }
570
571 // Use frequency calculations and code shape to predict if the block
572 // is uncommon.
573 bool is_uncommon(const Block* block);
570 574
571 #ifdef ASSERT 575 #ifdef ASSERT
572 Unique_Node_List _raw_oops; 576 Unique_Node_List _raw_oops;
573 #endif 577 #endif
574 578