RFR: 8296243: [IR Framework] Fix issues with IRNode.ALLOC* regexes

Christian Hagedorn chagedorn at openjdk.org
Fri Nov 11 09:46:15 UTC 2022


On Tue, 8 Nov 2022 09:58:42 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> There are currently two problems with `IRNode.ALLOC*` regexes:
> 1. On PPC64, we do not account for an `LI` instruction which matches the array size. As a result, we could miss some array allocations with the `ALLOC_ARRAY*` regexes:
> 
> 2e4     LD      R3, offset, R3   // load ptr precise [java/lang/Object:
> 0x0000200058006e40 *: :Constant:exact * from TOC (lo)
> 2e8     STD     R17, [R1_SP + #104+0]    // spill copy
> 2ec     LI      R4, #1    <------- we only look for LGHI here which is specific to s390 while LI is used for PPC64
> 2f0     CALL,static 0x00002000177cd300   // ==>  wrapper for: _new_array_Java
> 
> This was revealed by a new test added by [JDK-8280378](https://bugs.openjdk.org/browse/JDK-8280378) but was already a problem before this change.
> 
> 2. The newly added `IRNode.ALLOC*` regexes in JDK-8280378 which can be matched on the independent ideal compile phases by using the name of the IR node "Allocate" also matches "AllocateArray" (substring match). This is unexpected. I've changed this by matching "Allocate" exactly.
> 
> I've additionally removed the matching of `LI` and `LGHI` for the `ALLOC` regexes on normal objects as we do not have an array size. I think it's safe to remove these (might need some additional testing on PPC64/s390).
> 
> Thanks @TheRealMDoerr for helping to test the initial fix on PPC64!
> 
> Thanks,
> Christian

Thanks Tobias for your review! I've added a new line as suggested.

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

PR: https://git.openjdk.org/jdk/pull/11037


More information about the hotspot-compiler-dev mailing list