Integrated: 8337660: C2: basic blocks with only BoxLock nodes are wrongly treated as empty
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Tue Nov 26 08:54:59 UTC 2024
On Tue, 12 Nov 2024 12:37:21 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:
> This changeset takes into account the presence of `BoxLock` nodes in a basic block when determining whether the block is empty and [can be removed](https://github.com/openjdk/jdk/blob/5729227651969f542f040e5d0bfbf9b0b99b5698/src/hotspot/share/opto/compile.cpp#L2997). Special treatment of `BoxLock` nodes is required because these are not Mach nodes, yet they [are preserved in C2's back-end](https://github.com/openjdk/jdk/blob/f0b251d76078e8d5b47e967b0449c4cbdcb5a005/src/hotspot/share/opto/matcher.cpp#L2278) and result in [actual machine code being generated](https://github.com/openjdk/jdk/blob/f0b251d76078e8d5b47e967b0449c4cbdcb5a005/src/hotspot/cpu/x86/x86_64.ad#L1544). The proposed change avoids wrongly removing basic blocks consisting only of `BoxLock` and other non-Mach nodes, and crashing when the register that should have been defined by the wrongly removed `BoxLock` node is used (see complete failure analysis in the [JBS description](https://bugs.openjdk.org/browse/JDK-833766
0)).
>
> #### Testing
>
> - tier1-5 (windows-x64, linux-x64, linux-aarch64, macosx-x64, macosx-aarch64; release and debug mode)
This pull request has now been integrated.
Changeset: 01052035
Author: Roberto Castañeda Lozano <rcastanedalo at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/0105203575182e24a56a38a12da7c1af58ea0a78
Stats: 93 lines in 2 files changed: 88 ins; 0 del; 5 mod
8337660: C2: basic blocks with only BoxLock nodes are wrongly treated as empty
Co-authored-by: Emanuel Peter <epeter at openjdk.org>
Reviewed-by: qamai, thartmann, kvn
-------------
PR: https://git.openjdk.org/jdk/pull/22038
More information about the hotspot-compiler-dev
mailing list