RFR: 8258894: C2: Forbid GCM to move stores into loops [v2]

Tobias Hartmann thartmann at openjdk.java.net
Wed Jan 27 07:56:39 UTC 2021


On Tue, 26 Jan 2021 12:32:55 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

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

Marked as reviewed by thartmann (Reviewer).

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

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


More information about the hotspot-compiler-dev mailing list