diff options
author | Elena Demikhovsky <elena.demikhovsky@intel.com> | 2015-03-01 08:23:41 +0000 |
---|---|---|
committer | Elena Demikhovsky <elena.demikhovsky@intel.com> | 2015-03-01 08:23:41 +0000 |
commit | 0995479e67246b18c993b132c7be67f770dfed0b (patch) | |
tree | be94b861863afb30c58eac2260c04fa130d8fa44 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | 02ffd26023f75cd0a96072ed1444c78eb284cd0b (diff) | |
download | bcm5719-llvm-0995479e67246b18c993b132c7be67f770dfed0b.tar.gz bcm5719-llvm-0995479e67246b18c993b132c7be67f770dfed0b.zip |
Reverted 230471 - gather scatter handling in table gen.
llvm-svn: 230892
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 4e3e588fbad..20bf29eb859 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -1113,8 +1113,6 @@ static unsigned GetNumNodeResults(Record *Operator, CodeGenDAGPatterns &CDP) { // FIXME: Should allow access to all the results here. unsigned NumDefsToAdd = InstInfo.Operands.NumDefs ? 1 : 0; - if (InstInfo.hasTwoExplicitDefs) - ++NumDefsToAdd; // Add on one implicit def if it has a resolvable type. if (InstInfo.HasOneImplicitDefWithKnownVT(CDP.getTargetInfo()) !=MVT::Other) @@ -1611,20 +1609,11 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { assert(getNumTypes() == 0 && "Set doesn't produce a value"); assert(getNumChildren() >= 2 && "Missing RHS of a set?"); unsigned NC = getNumChildren(); - unsigned NumOfSrcs = NC-1; - // destination TreePatternNode *SetVal = getChild(NC-1); bool MadeChange = SetVal->ApplyTypeConstraints(TP, NotRegisters); - // second explicit destination - if (TP.getRecord()->getValueAsBit("hasTwoExplicitDefs")) { - TreePatternNode *Set2Val = getChild(NC-2); - MadeChange = Set2Val->ApplyTypeConstraints(TP, NotRegisters); - NumOfSrcs --; - } - - for (unsigned i = 0; i < NumOfSrcs; ++i) { + for (unsigned i = 0; i < NC-1; ++i) { TreePatternNode *Child = getChild(i); MadeChange |= Child->ApplyTypeConstraints(TP, NotRegisters); @@ -2867,7 +2856,7 @@ const DAGInstruction &CodeGenDAGPatterns::parseInstructionPattern( // Check that all of the results occur first in the list. std::vector<Record*> Results; - SmallVector<TreePatternNode *, 2> ResNode; + TreePatternNode *Res0Node = nullptr; for (unsigned i = 0; i != NumResults; ++i) { if (i == CGI.Operands.size()) I->error("'" + InstResults.begin()->first + @@ -2879,7 +2868,8 @@ const DAGInstruction &CodeGenDAGPatterns::parseInstructionPattern( if (!RNode) I->error("Operand $" + OpName + " does not exist in operand list!"); - ResNode.push_back(RNode); + if (i == 0) + Res0Node = RNode; Record *R = cast<DefInit>(RNode->getLeafValue())->getDef(); if (!R) I->error("Operand $" + OpName + " should be a set destination: all " @@ -2956,7 +2946,7 @@ const DAGInstruction &CodeGenDAGPatterns::parseInstructionPattern( GetNumNodeResults(I->getRecord(), *this)); // Copy fully inferred output node type to instruction result pattern. for (unsigned i = 0; i != NumResults; ++i) - ResultPattern->setType(i, ResNode[i]->getExtType(0)); + ResultPattern->setType(i, Res0Node->getExtType(i)); // Create and insert the instruction. // FIXME: InstImpResults should not be part of DAGInstruction. |