RFR: 8258894: C2: Forbid GCM to move stores into loops

Roberto Castañeda Lozano rcastanedalo at openjdk.java.net
Tue Jan 19 09:52:55 UTC 2021


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](https://bugs.openjdk.java.net/browse/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.

Tested functionality on:
- hs-tier1-5 (windows-x64, linux-x64, linux-aarch64, and macosx-x64; release and debug mode)
- hs-tier6-9 (linux-x64, debug mode)

Tested performance on a set of standard benchmark suites (DaCapo, Renaissance, SPECjbb2015, SPECjbb2005, SPECjvm2008, ...) and on windows-x64, linux-x64, and macosx-x64. No regression was observed, which is expected since this change only affects the placement of memory-writing nodes (which tends to be quite constrained already), and only forbids placements which would be typically detrimental for performance anyway (moving such nodes into deeper loops).

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

Commit messages:
 - 8258894: C2: Forbid GCM to move stores into loops

Changes: https://git.openjdk.java.net/jdk/pull/2140/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2140&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8258894
  Stats: 237 lines in 6 files changed: 195 ins; 2 del; 40 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2140.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2140/head:pull/2140

PR: https://git.openjdk.java.net/jdk/pull/2140


More information about the hotspot-compiler-dev mailing list