RFR: 8254317: C2: Resource consumption of ConvI2LNode::Ideal() grows exponentially
Roberto Castañeda Lozano
rcastanedalo at openjdk.java.net
Mon Oct 19 09:21:21 UTC 2020
In the optimization ConvI2L(AddI(x, y)) -> AddL(ConvI2L(x), ConvI2L(y)) within `ConvI2LNode::Ideal()`, handle the
special case x = y by feeding both inputs of AddL from a single ConvI2L node rather than creating two semantically
equivalent ConvI2L nodes. This avoids an exponential number of calls to `ConvI2LNode::Ideal()` when dealing with long
chains of AddI nodes. Disable the optimization for the pattern ConvI2L(SubI(x, x)), which is simplified to zero during
parsing anyway. Add a set of regression tests for the transformation that cover different shapes of AddI subgraphs.
Also add a microbenchmark that exercises the special case, for performance regression testing.
-------------
Commit messages:
- Merge master
- 8254317: C2: Resource consumption of ConvI2LNode::Ideal() grows exponentially
Changes: https://git.openjdk.java.net/jdk/pull/727/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=727&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8254317
Stats: 248 lines in 5 files changed: 243 ins; 0 del; 5 mod
Patch: https://git.openjdk.java.net/jdk/pull/727.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/727/head:pull/727
PR: https://git.openjdk.java.net/jdk/pull/727
More information about the hotspot-compiler-dev
mailing list