Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8257630: C2: ReplacedNodes doesn't handle non-CFG multi nodes
Reviewed-by: neliasso, kvn, thartmann
  • Loading branch information
Vladimir Ivanov committed Dec 4, 2020
1 parent d08c612 commit 4390f2c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/hotspot/share/opto/replacednodes.cpp
Expand Up @@ -120,7 +120,7 @@ static void enqueue_use(Node* n, Node* use, Unique_Node_List& work) {
}
}

// Perfom node replacement following late inlining
// Perform node replacement following late inlining.
void ReplacedNodes::apply(Compile* C, Node* ctl) {
// ctl is the control on exit of the method that was late inlined
if (is_empty()) {
Expand All @@ -144,20 +144,22 @@ void ReplacedNodes::apply(Compile* C, Node* ctl) {
work.clear();
enqueue_use(initial, use, work);
bool replace = true;
// Check that this use is dominated by ctl. Go ahead with the
// replacement if it is.
// Check that this use is dominated by ctl. Go ahead with the replacement if it is.
while (work.size() != 0 && replace) {
Node* n = work.pop();
if (use->outcnt() == 0) {
continue;
}
if (n->is_CFG() || (n->in(0) != NULL && !n->in(0)->is_top())) {
int depth = 0;
Node *m = n;
// Skip projections, since some of the multi nodes aren't CFG (e.g., LoadStore and SCMemProj).
if (n->is_Proj()) {
n = n->in(0);
}
if (!n->is_CFG()) {
n = n->in(0);
}
assert(n->is_CFG(), "should be CFG now");
int depth = 0;
while(n != ctl) {
n = IfNode::up_one_dom(n);
depth++;
Expand Down

1 comment on commit 4390f2c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.