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


On Mon, 19 Oct 2020 08:36:53 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

> 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.

Tested on tier1-3 on windows-x64, linux-x64, linux-aarch64, and macosx-x64 in both release and debug mode.

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

PR: https://git.openjdk.java.net/jdk/pull/727


More information about the hotspot-compiler-dev mailing list