RFR: 8258894: C2: Forbid GCM to move stores into loops [v2]
Roberto Castañeda Lozano
rcastanedalo at openjdk.java.net
Tue Jan 26 12:32: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).
Roberto Castañeda Lozano has updated the pull request incrementally with one additional commit since the last revision:
Use NOT_DEBUG_RETURN in PhaseCFG verification functions
Move is_memory_writer() test into PhaseCFG::verify_memory_writer_placement(),
mark the function as NOT_DEBUG_RETURN, and make it independent of the PRODUCT
flag. Apply the same refactoring to PhaseCFG::verify(), for consistency.
Simplify callers of both functions accordingly.
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/2140/files
- new: https://git.openjdk.java.net/jdk/pull/2140/files/132f7582..d8ff541b
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2140&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2140&range=00-01
Stats: 29 lines in 4 files changed: 9 ins; 15 del; 5 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