[jdk16] RFR: 8255763: C2: OSR miscompilation caused by invalid memory instruction placement [v2]

Roberto Castañeda Lozano rcastanedalo at openjdk.java.net
Fri Dec 18 10:58:40 UTC 2020


> 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.

Roberto Castañeda Lozano has updated the pull request incrementally with one additional commit since the last revision:

  Move asterisk in pointer declaration for consistency

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk16/pull/22/files
  - new: https://git.openjdk.java.net/jdk16/pull/22/files/622299c3..4f2763c2

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk16&pr=22&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk16&pr=22&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk16/pull/22.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/22/head:pull/22

PR: https://git.openjdk.java.net/jdk16/pull/22


More information about the hotspot-compiler-dev mailing list