Skip to content

Commit 05bf3b6

Browse files
author
git apple-llvm automerger
committed
Merge commit '66da9f38f374' from llvm.org/main into next
2 parents ad33224 + 66da9f3 commit 05bf3b6

File tree

2 files changed

+3386
-1
lines changed

2 files changed

+3386
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13872,6 +13872,8 @@ void SelectionDAG::copyExtraInfo(SDNode *From, SDNode *To) {
1387213872
return;
1387313873
}
1387413874

13875+
const SDNode *EntrySDN = getEntryNode().getNode();
13876+
1387513877
// We need to copy NodeExtraInfo to all _new_ nodes that are being introduced
1387613878
// through the replacement of From with To. Otherwise, replacements of a node
1387713879
// (From) with more complex nodes (To and its operands) may result in lost
@@ -13903,9 +13905,14 @@ void SelectionDAG::copyExtraInfo(SDNode *From, SDNode *To) {
1390313905
return true;
1390413906
if (!Visited.insert(N).second)
1390513907
return true;
13906-
if (getEntryNode().getNode() == N)
13908+
if (EntrySDN == N)
1390713909
return false;
1390813910
for (const SDValue &Op : N->op_values()) {
13911+
if (N == To && Op.getNode() == EntrySDN) {
13912+
// Special case: New node's operand is the entry node; just need to
13913+
// copy extra info to new node.
13914+
break;
13915+
}
1390913916
if (!Self(Self, Op.getNode()))
1391013917
return false;
1391113918
}

0 commit comments

Comments
 (0)