RFR: 8373134: C2: Min/Max users of Min/Max uses should be enqueued for GVN [v8]
Galder Zamarreño
galder at openjdk.org
Fri Jan 9 16:14:17 UTC 2026
> Min/Max users of Min/Max uses need to be enqueued respectively to the GVN worklist to see if further optimizations can be applied. Without this, there are cases where additional potential ideal/identity optimizations are not applied. I need this fix to test min/max reassociation implementation with IR tests reliably.
>
> Aside from the fix itself, I've refactored `MaxNode` to `MinMaxNode` and added a `is_MinMax` node query to simplify the fix.
>
> I have also removed the Min/Max exceptions in `PhaseIterGVN::verify_Identity_for` since this fix fixes `compiler/codegen/TestBooleanVect.java` with `-XX:VerifyIterativeGVN=1110`.
>
> To test this I've created a template framework test that validates the fix. I have tested with all Min/Max combinations including Float16, which I've verified with Intel SDE. Float16 does not use `Argument.NUMBER_42` because there's no support for it yet, see [JDK-8373977](https://bugs.openjdk.org/browse/JDK-8373977).
>
> During development I noticed that the test only failed when the test had `b, a` parameters in that order, so I added tests for both cases as `a, b` and `b, a` so that all possible orders are covered and they don't slip in the future.
>
> I've run tier1-3 tests on linux/x64 successfully.
Galder Zamarreño has updated the pull request incrementally with two additional commits since the last revision:
- Update test/hotspot/jtreg/compiler/igvn/TestMinMaxIdentity.java
Co-authored-by: Emanuel Peter <emanuel.peter at oracle.com>
- Fix style
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28895/files
- new: https://git.openjdk.org/jdk/pull/28895/files/fe71e03f..2c0b0e43
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28895&range=07
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28895&range=06-07
Stats: 7 lines in 2 files changed: 0 ins; 0 del; 7 mod
Patch: https://git.openjdk.org/jdk/pull/28895.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28895/head:pull/28895
PR: https://git.openjdk.org/jdk/pull/28895
More information about the hotspot-compiler-dev
mailing list