Request for reviews (M): 6890673: Eliminate allocations immediately after EA

Vladimir Kozlov vladimir.kozlov at oracle.com
Mon Nov 14 18:28:23 PST 2011


http://cr.openjdk.java.net/~kvn/6890673/webrev

6890673: Eliminate allocations immediately after EA

Currently non-escaping allocations and corresponding locks are eliminated during 
macro nodes expansion after all ideal and loop optimizations which may prevent 
to do more aggressive (loop and split-if) optimizations.

Try to eliminate allocations and related locks immediately after escape 
analysis. Move elimination code into new separate method 
PhaseMacroExpand::eliminate_macro_nodes().

The main problem was that SafePointScalarObject may be referenced by several 
safepoints which were cloned, for example, during loop unswitch. As result 
current checks that SPSO should be pinned and at the same block as safepoint 
failed. Nothing is wrong to have one SPSO node be referenced by several cloned 
safepoints since SPSO contains only class information and index of safepoin's 
debug info edge which should stay the same for cloned safepoints. The solution 
is to removed pinned attribute from SPSO node, use Root as control edge and add 
hash(), cmp() to not allow value-numbering of these nodes.

Removed SPSO asserts in block.cpp and the rest is mostly code style clean up.

Locks eliminated by "lock coarsening" optimization are treated differently 
during elimination since corresponding outer locks should stay. Such locks 
marked by "_coarsened" flag. EA should clean this flag for locks which could be 
eliminated because corresponding object does not escape.

Don't bail out from build_and_optimize() until dead code is eliminated when it 
is called before EA even if there are no loops or there are only irreducible loops.

Added missing (in(0)->is_top()) checks after remove_dead_region() calls.

Thanks,
Vladimir


More information about the hotspot-compiler-dev mailing list