[llvm] r343950 - Revert r343948 "[LegalizeDAG] Make one of the ReplaceNode signatures take an ArrayRef instead a pointer to an array. Add assert on size of array. NFC"
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 7 20:12:12 PDT 2018
Author: ctopper
Date: Sun Oct 7 20:12:12 2018
New Revision: 343950
URL: http://llvm.org/viewvc/llvm-project?rev=343950&view=rev
Log:
Revert r343948 "[LegalizeDAG] Make one of the ReplaceNode signatures take an ArrayRef instead a pointer to an array. Add assert on size of array. NFC"
The assert is failing some asan tests on the bots.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=343950&r1=343949&r2=343950&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sun Oct 7 20:12:12 2018
@@ -222,12 +222,10 @@ public:
ReplacedNode(Old.getNode());
}
- void ReplaceNode(SDNode *Old, ArrayRef<SDValue> New) {
- assert(Old->getNumValues() == New.size() &&
- "Replacing with a different number of values!");
+ void ReplaceNode(SDNode *Old, const SDValue *New) {
LLVM_DEBUG(dbgs() << " ... replacing: "; Old->dump(&DAG));
- DAG.ReplaceAllUsesWith(Old, New.data());
+ DAG.ReplaceAllUsesWith(Old, New);
for (unsigned i = 0, e = Old->getNumValues(); i != e; ++i) {
LLVM_DEBUG(dbgs() << (i == 0 ? " with: " : " and: ");
New[i]->dump(&DAG));
@@ -1206,7 +1204,7 @@ void SelectionDAGLegalize::LegalizeOp(SD
for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i)
ResultVals.push_back(Res.getValue(i));
LLVM_DEBUG(dbgs() << "Successfully custom legalized node\n");
- ReplaceNode(Node, ResultVals);
+ ReplaceNode(Node, ResultVals.data());
return;
}
LLVM_DEBUG(dbgs() << "Could not custom legalize node\n");
@@ -3961,7 +3959,7 @@ bool SelectionDAGLegalize::ExpandNode(SD
}
LLVM_DEBUG(dbgs() << "Successfully expanded node\n");
- ReplaceNode(Node, Results);
+ ReplaceNode(Node, Results.data());
return true;
}
@@ -4288,7 +4286,7 @@ void SelectionDAGLegalize::ConvertNodeTo
// Replace the original node with the legalized result.
if (!Results.empty()) {
LLVM_DEBUG(dbgs() << "Successfully converted node to libcall\n");
- ReplaceNode(Node, Results);
+ ReplaceNode(Node, Results.data());
} else
LLVM_DEBUG(dbgs() << "Could not convert node to libcall\n");
}
@@ -4743,7 +4741,7 @@ void SelectionDAGLegalize::PromoteNode(S
// Replace the original node with the legalized result.
if (!Results.empty()) {
LLVM_DEBUG(dbgs() << "Successfully promoted node\n");
- ReplaceNode(Node, Results);
+ ReplaceNode(Node, Results.data());
} else
LLVM_DEBUG(dbgs() << "Could not promote node\n");
}
More information about the llvm-commits
mailing list