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

Christian Hagedorn chagedorn at openjdk.org
Mon Nov 14 08:29:54 UTC 2022


> 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

Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:

  remove whitespaces

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11037/files
  - new: https://git.openjdk.org/jdk/pull/11037/files/0d28220f..24713be2

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11037&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11037&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/11037.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11037/head:pull/11037

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


More information about the hotspot-compiler-dev mailing list