8268884: C2: Compile::remove_speculative_types must iterate top-down #170
Conversation
|
Webrevs
|
Hi Nils, |
Compile::remove_speculative_types() traverses the graph bottom up. The checkcast is part of an infinite loop with no exit edge. It can't be reached from below. |
Wouldn't it make sense then to improve Compile::remove_speculative_types() so we're guaranteed it removes all of them? |
Absolutely. My first fix didn't take into account that the speculative types should have been removed. |
The new suggested fix changes so that Compile::remove_speculative_types() iterates the nodes from top to bottom. With this change all nodes that are reachable from the top will be visited. |
@neliasso This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 10 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the
|
Please, add comments in both places explaining why we changed direction (from inputs to outputs).
Otherwise based on Roland and your comment fix seems fine.
/integrate |
Going to push as commit b8a16e9.
Your commit was automatically rebased without conflicts. |
Hi,
The test fails on "assert(t->meet(t0) == t) failed: Not monotonic" in PhaseCCP for a CheckCastPPNode. The test is really simple. The CheckCastPP is hanging of the ParmNode for the 'this' pointer. The user of this is a call, with an infinite empty loop, that gets inlined. The loop will have a safepoint that keeps the JVM State - the CheckCastPP is kept alive by that SafePointNode.
The assert triggers because the type for the CheckCastPP has a speculative part. In the assert "assert(t->meet(t0) == t) failed: Not monotonic" - t is the type evaluated for the CheckCastPP, t0 is the previous type (from _types map), which has not been updated yet and is still Type::Top.
t->meet(t0) will drop the speculative part and fail the comparison.
Suggested fix - change meet to meet_specualtive that will keep the speculative part.
Please review,
Best regards,
Nils Eliasson
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk17 pull/170/head:pull/170
$ git checkout pull/170
Update a local copy of the PR:
$ git checkout pull/170
$ git pull https://git.openjdk.java.net/jdk17 pull/170/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 170
View PR using the GUI difftool:
$ git pr show -t 170
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk17/pull/170.diff