<div dir="ltr">Might be best to try one change at a time, if possible - if you can't isolate/debug this locally (though to find the issue locally, the same advice might be helpful).</div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jun 10, 2018 at 2:10 PM Florian Hahn via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: fhahn<br>
Date: Sun Jun 10 14:06:24 2018<br>
New Revision: 334376<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=334376&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=334376&view=rev</a><br>
Log:<br>
Revert r334374 [TableGen] Move some shared_ptrs to avoid unnecessary copies (NFC).<br>
<br>
This breaks some builders.<br>
<br>
Modified:<br>
llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp<br>
llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h<br>
<br>
Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp?rev=334376&r1=334375&r2=334376&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp?rev=334376&r1=334375&r2=334376&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp (original)<br>
+++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp Sun Jun 10 14:06:24 2018<br>
@@ -1825,7 +1825,7 @@ void TreePatternNode::SubstituteFormalAr<br>
assert((Child->getPredicateFns().empty() ||<br>
NewChild->getPredicateFns() == Child->getPredicateFns()) &&<br>
"Non-empty child predicate clobbered!");<br>
- setChild(i, std::move(NewChild));<br>
+ setChild(i, NewChild);<br>
}<br>
} else {<br>
getChild(i)->SubstituteFormalArguments(ArgMap);<br>
@@ -1856,7 +1856,7 @@ TreePatternNodePtr TreePatternNode::Inli<br>
NewChild->getPredicateFns() == Child->getPredicateFns()) &&<br>
"Non-empty child predicate clobbered!");<br>
<br>
- setChild(i, std::move(NewChild));<br>
+ setChild(i, NewChild);<br>
}<br>
return T;<br>
}<br>
@@ -1884,8 +1884,7 @@ TreePatternNodePtr TreePatternNode::Inli<br>
std::map<std::string, TreePatternNodePtr> ArgMap;<br>
for (unsigned i = 0, e = Frag->getNumArgs(); i != e; ++i) {<br>
TreePatternNodePtr Child = getChildShared(i);<br>
- ArgMap[Frag->getArgName(i)] =<br>
- Child->InlinePatternFragments(std::move(Child), TP);<br>
+ ArgMap[Frag->getArgName(i)] = Child->InlinePatternFragments(Child, TP);<br>
}<br>
<br>
FragTree->SubstituteFormalArguments(ArgMap);<br>
@@ -2674,8 +2673,9 @@ TreePatternNodePtr TreePattern::ParseTre<br>
else // Otherwise, no chain.<br>
Operator = getDAGPatterns().get_intrinsic_wo_chain_sdnode();<br>
<br>
- Children.insert(Children.begin(),<br>
- std::make_shared<TreePatternNode>(IntInit::get(IID), 1));<br>
+ TreePatternNodePtr IIDNode =<br>
+ std::make_shared<TreePatternNode>(IntInit::get(IID), 1);<br>
+ Children.insert(Children.begin(), IIDNode);<br>
}<br>
<br>
if (Operator->isSubClassOf("ComplexPattern")) {<br>
@@ -2736,7 +2736,7 @@ static bool SimplifyTree(TreePatternNode<br>
for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i) {<br>
TreePatternNodePtr Child = N->getChildShared(i);<br>
MadeChange |= SimplifyTree(Child);<br>
- N->setChild(i, std::move(Child));<br>
+ N->setChild(i, Child);<br>
}<br>
return MadeChange;<br>
}<br>
@@ -3057,7 +3057,7 @@ void CodeGenDAGPatterns::ParseDefaultOpe<br>
DefaultOps[i]->getName() +<br>
"' doesn't have a concrete type!");<br>
}<br>
- DefaultOpInfo.DefaultOps.push_back(std::move(TPN));<br>
+ DefaultOpInfo.DefaultOps.push_back(TPN);<br>
}<br>
<br>
// Insert it into the DefaultOperands map so we can find it later.<br>
@@ -3487,9 +3487,9 @@ const DAGInstruction &CodeGenDAGPatterns<br>
if (!RNode)<br>
I->error("Operand $" + OpName + " does not exist in operand list!");<br>
<br>
+ ResNodes.push_back(RNode);<br>
<br>
Record *R = cast<DefInit>(RNode->getLeafValue())->getDef();<br>
- ResNodes.push_back(std::move(RNode));<br>
if (!R)<br>
I->error("Operand $" + OpName + " should be a set destination: all "<br>
"outputs must occur before inputs in operand list!");<br>
@@ -3554,7 +3554,7 @@ const DAGInstruction &CodeGenDAGPatterns<br>
OpNode->getNumTypes());<br>
}<br>
<br>
- ResultNodeOperands.push_back(std::move(OpNode));<br>
+ ResultNodeOperands.push_back(OpNode);<br>
}<br>
<br>
if (!InstInputsCheck.empty())<br>
@@ -4080,10 +4080,9 @@ void CodeGenDAGPatterns::ExpandHwModeBas<br>
std::vector<Predicate> Preds = P.Predicates;<br>
const std::vector<Predicate> &MC = ModeChecks[Mode];<br>
Preds.insert(Preds.end(), MC.begin(), MC.end());<br>
- PatternsToMatch.emplace_back(P.getSrcRecord(), Preds, std::move(NewSrc),<br>
- std::move(NewDst), P.getDstRegs(),<br>
- P.getAddedComplexity(), Record::getNewUID(),<br>
- Mode);<br>
+ PatternsToMatch.emplace_back(P.getSrcRecord(), Preds, NewSrc, NewDst,<br>
+ P.getDstRegs(), P.getAddedComplexity(),<br>
+ Record::getNewUID(), Mode);<br>
};<br>
<br>
for (PatternToMatch &P : Copy) {<br>
@@ -4387,18 +4386,18 @@ static void GenerateVariantsOf(TreePatte<br>
assert(NC >= 3 &&<br>
"Commutative intrinsic should have at least 3 children!");<br>
std::vector<std::vector<TreePatternNodePtr>> Variants;<br>
- Variants.push_back(std::move(ChildVariants[0])); // Intrinsic id.<br>
- Variants.push_back(std::move(ChildVariants[2]));<br>
- Variants.push_back(std::move(ChildVariants[1]));<br>
+ Variants.push_back(ChildVariants[0]); // Intrinsic id.<br>
+ Variants.push_back(ChildVariants[2]);<br>
+ Variants.push_back(ChildVariants[1]);<br>
for (unsigned i = 3; i != NC; ++i)<br>
- Variants.push_back(std::move(ChildVariants[i]));<br>
+ Variants.push_back(ChildVariants[i]);<br>
CombineChildVariants(N, Variants, OutVariants, CDP, DepVars);<br>
} else if (NC == N->getNumChildren()) {<br>
std::vector<std::vector<TreePatternNodePtr>> Variants;<br>
- Variants.push_back(std::move(ChildVariants[1]));<br>
- Variants.push_back(std::move(ChildVariants[0]));<br>
+ Variants.push_back(ChildVariants[1]);<br>
+ Variants.push_back(ChildVariants[0]);<br>
for (unsigned i = 2; i != NC; ++i)<br>
- Variants.push_back(std::move(ChildVariants[i]));<br>
+ Variants.push_back(ChildVariants[i]);<br>
CombineChildVariants(N, Variants, OutVariants, CDP, DepVars);<br>
}<br>
}<br>
<br>
Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h?rev=334376&r1=334375&r2=334376&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h?rev=334376&r1=334375&r2=334376&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h (original)<br>
+++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h Sun Jun 10 14:06:24 2018<br>
@@ -813,11 +813,7 @@ public:<br>
const std::vector<TreePatternNodePtr> &getTrees() const { return Trees; }<br>
unsigned getNumTrees() const { return Trees.size(); }<br>
const TreePatternNodePtr &getTree(unsigned i) const { return Trees[i]; }<br>
-<br>
- void setTree(unsigned i, TreePatternNodePtr Tree) {<br>
- Trees[i] = std::move(Tree);<br>
- }<br>
-<br>
+ void setTree(unsigned i, TreePatternNodePtr Tree) { Trees[i] = Tree; }<br>
TreePatternNodePtr getOnlyTree() const {<br>
assert(Trees.size() == 1 && "Doesn't have exactly one pattern!");<br>
return Trees[0];<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>