RFR: 8315377: C2: assert(u->find_out_with(Op_AddP) == nullptr) failed: more than 2 chained AddP nodes?

Roland Westrelin roland at openjdk.org
Mon Sep 4 16:10:56 UTC 2023


`PhaseIdealLoop::try_sink_out_of_loop()` has special logic to handle
`AddP` nodes so, after it has been processed, all nodes in the chain
of `AddP` nodes still have the same base input. That logic assumes a
chain is only composed of at most 2 nodes. That's not true because
`PhaseIdealLoop::remix_address_expressions()` can cause longer chains
to exist. There's actually no clear upper bound on the number of nodes
in such a chain. The fix I propose here is simply to extend the logic
in `PhaseIdealLoop::try_sink_out_of_loop()` to handle arbitrary
chains.

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

Commit messages:
 - fix

Changes: https://git.openjdk.org/jdk/pull/15562/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15562&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8315377
  Stats: 106 lines in 3 files changed: 94 ins; 6 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/15562.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15562/head:pull/15562

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


More information about the hotspot-compiler-dev mailing list