src/share/vm/opto/gcm.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6784930 Cdiff src/share/vm/opto/gcm.cpp

src/share/vm/opto/gcm.cpp

Print this page

        

*** 27,36 **** --- 27,39 ---- // Optimization - Graph Style #include "incls/_precompiled.incl" #include "incls/_gcm.cpp.incl" + // To avoid float value underflow + #define MIN_BLOCK_FREQUENCY 1.e-35f + //----------------------------schedule_node_into_block------------------------- // Insert node n into block b. Look for projections of n and make sure they // are in b also. void PhaseCFG::schedule_node_into_block( Node *n, Block *b ) { // Set basic block of n, Add n to b,
*** 1378,1387 **** --- 1381,1397 ---- } } } } + #ifdef ASSERT + for (uint i = 0; i < _num_blocks; i++ ) { + Block *b = _blocks[i]; + assert(b->_freq >= MIN_BLOCK_FREQUENCY, "Register Allocator requiers meaningful block frequency"); + } + #endif + #ifndef PRODUCT if (PrintCFGBlockFreq) { tty->print_cr("CFG Block Frequencies"); _root_loop->dump_tree(); if (Verbose) {
*** 1875,1885 **** // Do a top down traversal of loop tree (visit outer loops first.) void CFGLoop::scale_freq() { float loop_freq = _freq * trip_count(); for (int i = 0; i < _members.length(); i++) { CFGElement* s = _members.at(i); ! s->_freq *= loop_freq; } CFGLoop* ch = _child; while (ch != NULL) { ch->scale_freq(); ch = ch->_sibling; --- 1885,1897 ---- // Do a top down traversal of loop tree (visit outer loops first.) void CFGLoop::scale_freq() { float loop_freq = _freq * trip_count(); for (int i = 0; i < _members.length(); i++) { CFGElement* s = _members.at(i); ! float block_freq = s->_freq * loop_freq; ! if (block_freq < MIN_BLOCK_FREQUENCY) block_freq = MIN_BLOCK_FREQUENCY; ! s->_freq = block_freq; } CFGLoop* ch = _child; while (ch != NULL) { ch->scale_freq(); ch = ch->_sibling;
src/share/vm/opto/gcm.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File