diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-24 00:06:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-24 00:06:46 +0000 |
commit | 38c99662ff732be6e7195b4220303e9fce55ffd6 (patch) | |
tree | 4e142c943c766348e6d433861ec5e8241e801235 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | e0874fa02fea992e7f404ebae6599c15bb37d56c (diff) | |
download | bcm5719-llvm-38c99662ff732be6e7195b4220303e9fce55ffd6.tar.gz bcm5719-llvm-38c99662ff732be6e7195b4220303e9fce55ffd6.zip |
implement SDTCisVTSmallerThanOp with EnforceSmallerThan
instead of reimplementing it wrong and poorly.
llvm-svn: 99357
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 08d81b857b4..ffb9ba90f3a 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -627,22 +627,15 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N, TP.error(N->getOperator()->getName() + " expects a VT operand!"); MVT::SimpleValueType VT = getValueType(static_cast<DefInit*>(NodeToApply->getLeafValue())->getDef()); - if (!isInteger(VT)) - TP.error(N->getOperator()->getName() + " VT operand must be integer!"); + + EEVT::TypeSet TypeListTmp(VT, TP); unsigned OResNo = 0; TreePatternNode *OtherNode = getOperandNum(x.SDTCisVTSmallerThanOp_Info.OtherOperandNum, N, NodeInfo, OResNo); - - // It must be integer. - bool MadeChange = OtherNode->getExtType(OResNo).EnforceInteger(TP); - // This doesn't try to enforce any information on the OtherNode, it just - // validates it when information is determined. - if (OtherNode->hasTypeSet(OResNo) && OtherNode->getType(OResNo) <= VT) - OtherNode->UpdateNodeType(OResNo, MVT::Other, TP); // Throw an error. - return MadeChange; + return TypeListTmp.EnforceSmallerThan(OtherNode->getExtType(OResNo), TP); } case SDTCisOpSmallerThanOp: { unsigned BResNo = 0; |