Mercurial > hg > truffle
diff src/share/vm/opto/compile.cpp @ 418:72c5366e5d86
6743900: frequency based block layout
Summary: post-register allocation pass that drives block layout by edge frequencies
Reviewed-by: never, kvn
author | rasbold |
---|---|
date | Thu, 06 Nov 2008 14:59:10 -0800 |
parents | f4fe12e429a4 |
children | a1980da045cc |
line wrap: on
line diff
--- a/src/share/vm/opto/compile.cpp Thu Oct 30 17:08:48 2008 -0700 +++ b/src/share/vm/opto/compile.cpp Thu Nov 06 14:59:10 2008 -0800 @@ -822,6 +822,7 @@ Copy::zero_to_bytes(_trap_hist, sizeof(_trap_hist)); set_decompile_count(0); + set_do_freq_based_layout(BlockLayoutByFrequency || method_has_option("BlockLayoutByFrequency")); // Compilation level related initialization if (env()->comp_level() == CompLevel_fast_compile) { set_num_loop_opts(Tier1LoopOptsCount); @@ -1701,8 +1702,14 @@ // are not adding any new instructions. If any basic block is empty, we // can now safely remove it. { - NOT_PRODUCT( TracePhase t2("removeEmpty", &_t_removeEmptyBlocks, TimeCompiler); ) - cfg.RemoveEmpty(); + NOT_PRODUCT( TracePhase t2("blockOrdering", &_t_blockOrdering, TimeCompiler); ) + cfg.remove_empty(); + if (do_freq_based_layout()) { + PhaseBlockLayout layout(cfg); + } else { + cfg.set_loop_alignment(); + } + cfg.fixup_flow(); } // Perform any platform dependent postallocation verifications.