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