8315088: C2: assert(wq.size() - before == EMPTY_LOOP_SIZE) failed: expect the EMPTY_LOOP_SIZE nodes of this body if empty#15520
8315088: C2: assert(wq.size() - before == EMPTY_LOOP_SIZE) failed: expect the EMPTY_LOOP_SIZE nodes of this body if empty#15520rwestrel wants to merge 4 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back roland! A progress list of the required criteria for merging this PR into |
Webrevs
|
test/hotspot/jtreg/compiler/loopstripmining/TestBrokenEmptyLoopLogic.java
Outdated
Show resolved
Hide resolved
TobiHartmann
left a comment
There was a problem hiding this comment.
Thanks for the detailed description, the fix looks good to me.
|
|
||
| /** | ||
| * @test | ||
| * @bug 8315088 |
There was a problem hiding this comment.
Please add a @requires vm.compiler2.enabled
|
@rwestrel This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. 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 165 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
…pLogic.java Co-authored-by: Andrey Turbanov <turbanoff@gmail.com>
|
@TobiHartmann @chhagedorn thanks for the reviews |
|
/integrate |
|
Going to push as commit fe4f900.
Your commit was automatically rebased without conflicts. |
The assert fires in code that looks for counted loops that would be
empty if not part of a loop strip mining nest (that is some nodes in
the the loop body are kept alive because of the safepoint in the outer
loop, the loop would otherwise be empty). That logic starts by finding
the set of
EMPTY_LOOP_SIZEnodes that are core to all counted loops(exit test, iv phi etc) and store them in the
empty_loop_nodeslist.
Finding the "core" nodes is performed by
IdealLoopTree::collect_loop_core_nodes. It enqueues the backedge ofthe loop in
empty_loop_nodesand then iteratively pushes inputs ofnodes in
empty_loop_nodesthat belongs to the loop until it can'tmake progress. There should be
EMPTY_LOOP_SIZEof those nodes.It's possible that that 2 or more loops are involved in the process:
a node n in loop 1 could be kept alive by the safepoint of loop 2 so
loop 2 needs to be empty for n to become dead and possibly loop 1 to
be empty. When that happens while the logic is in the process of
determining if loop 1 is empty, it needs to also collect the
EMPTY_LOOP_SIZEnodes that make the "core" of loop 2. They areenqueued to the
empty_loop_nodeslist too.The failure happens when
empty_loop_nodesalready has the "core"nodes of loop 1 and "core" nodes for loop 2 are collected. In the
process
IdealLoopTree::collect_loop_core_nodesiterates on allempty_loop_nodes(loop 1 nodes included, not just starting from theloop 2 backedge). That's inefficient (loop 1 nodes can't help find
nodes that belong to loop 2) and wrong because there could be an edge
from a node in loop 1 to a node in the body of loop 2. That node in
loop 2 is them pushed to the
empty_loop_nodeslist.The fix I propose is to only iterate over loop 2 nodes when loop 2 is
processed.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15520/head:pull/15520$ git checkout pull/15520Update a local copy of the PR:
$ git checkout pull/15520$ git pull https://git.openjdk.org/jdk.git pull/15520/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15520View PR using the GUI difftool:
$ git pr show -t 15520Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15520.diff
Webrev
Link to Webrev Comment