Commit Graph

3 Commits

Author SHA1 Message Date
Tobias Holenstein
f5cbe53fdd 8027711: Unify wildcarding syntax for CompileCommand and CompileOnly
Reviewed-by: kvn, thartmann, chagedorn
2023-06-12 07:39:23 +00:00
Roberto Castañeda Lozano
f353fcf256 8258894: C2: Forbid GCM to move stores into loops
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
2021-01-27 15:08:39 +00:00
Roberto Castañeda Lozano
4e8338eb13 8255763: C2: OSR miscompilation caused by invalid memory instruction placement
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
2020-12-21 13:04:24 +00:00