Integrated: 8339303: C2: dead node after failing to match cloned address expression
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Wed Nov 6 09:20:39 UTC 2024
On Fri, 1 Nov 2024 13:53:33 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:
> This changeset prevents the x86 platform-specific logic from cloning address expressions consisting of two chained `AddP` nodes with a small constant offset each, such as in the following example:
>
> 
>
> Such patterns cannot be fully subsumed into x86 complex addressing modes, and cloning them can cause the matcher to introduce dead nodes that trigger a segmentation fault in the subsequent global code motion phase. See a detailed analysis of the failure in the [JBS issue description](https://bugs.openjdk.org/browse/JDK-8339303).
>
> The changeset additionally extends the post-matching verification logic to check that no old node is reachable by travesing both node inputs and outputs. This extension would have caused the original test case to fail directly after matching with an informative assertion message rather than an opaque segmentation fault in an unrelated code generation phase.
>
> Note that the pattern causing the failure should be in general optimized by `AddPNode::Ideal` into a single `AddP` node with the constant sum of the offsets. While [JDK-8343067](https://bugs.openjdk.org/browse/JDK-8343067) should address the missing optimization, this changeset proposes a complementary solution that is easily backportable and avoids relying on specific optimizations for correctness.
>
> #### Testing
>
> ##### Functionality
>
> - tier1-5 (linux-x64, windows-x64, macosx-x64, linux-aarch64, macosx-aarch64; release and debug mode).
>
> ##### Performance
>
> - Tested performance on a set of standard benchmark suites (DaCapo, SPECjbb2015, SPECjvm2008). No significant change was observed.
This pull request has now been integrated.
Changeset: 83f3d42d
Author: Roberto Castañeda Lozano <rcastanedalo at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/83f3d42d6bcefac80449987f4d951f8280eeee3a
Stats: 73 lines in 3 files changed: 67 ins; 3 del; 3 mod
8339303: C2: dead node after failing to match cloned address expression
Reviewed-by: vlivanov, kvn
-------------
PR: https://git.openjdk.org/jdk/pull/21829
More information about the hotspot-compiler-dev
mailing list