Skip to content
Permalink
Browse files
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 4390f2c8c3e87312ab25bb829f180c5d4d898361
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/hotspot/share/opto/replacednodes.cpp
@@ -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()) {
@@ -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++;

1 comment on commit 4390f2c

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 4390f2c Dec 4, 2020

Please sign in to comment.