Relax assertion in PhaseCFG::verify() to accept the case where a store is used
to implement an implicit null check and a load is placed in the null block.
Reviewed-by: thartmann, kvn
Prevent GCM from placing memory-writing nodes (such as stores) into loops deeper
than their home loop (determined by their control input). Such placements are
invalid, as they cause memory definitions to interfere, and risk causing
miscompilations. This change complements JDK-8255763, which only addresses
invalid placements in irreducible CFGs.
Add control input to stores in generated stubs to ensure that all memory-writing
nodes have control inputs from which their home block can be derived.
Add a battery of simplified fuzzer test cases where, before this change, GCM
moves stores into deeper loops.
Reviewed-by: thartmann, kvn
Disable GCM hoisting of memory-writing nodes for irreducible CFGs. This prevents
GCM from wrongly "hoisting" stores into descendants of their original loop. Such
an "inverted hoisting" can happen due to CFGLoop::compute_freq()'s inaccurate
estimation of frequencies for irreducible CFGs.
Extend CFG verification code by checking that memory-writing nodes are placed in
either their original loop or an ancestor.
Add tests for the reducible and irreducible cases. The former was already
handled correctly before the change (the frequency estimation model prevents
"inverted hoisting" for reducible CFGs), and is just added for coverage.
This change addresses the specific miscompilation issue in a conservative way,
for simplicity and safety. Future work includes investigating if only the
illegal blocks can be discarded as candidates for GCM hoisting, and refining
frequency estimation for irreducible CFGs.
Reviewed-by: kvn, chagedorn
Use the compilation-local seed in 'StressLCM' and 'StressGCM' rather than the
global one. As a consequence, these options use by default a fresh seed in every
compilation, unless 'StressSeed=N' is specified, in which case they behave
deterministically. Annotate tests that use 'StressLCM' and 'StressGCM' with the
'stress' and 'randomness' keys to reflect this change in default behavior.
Reviewed-by: kvn, thartmann
Change the type of symbolic constant badAddressVal and introduce specific casts to fix multiple type cast conversion compilation errors.
Reviewed-by: coleenp, kbarrett