[llvm-commits] [llvm] r99357 - /llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
Chris Lattner
sabre at nondot.org
Tue Mar 23 17:06:46 PDT 2010
Author: lattner
Date: Tue Mar 23 19:06:46 2010
New Revision: 99357
URL: http://llvm.org/viewvc/llvm-project?rev=99357&view=rev
Log:
implement SDTCisVTSmallerThanOp with EnforceSmallerThan
instead of reimplementing it wrong and poorly.
Modified:
llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp?rev=99357&r1=99356&r2=99357&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp Tue Mar 23 19:06:46 2010
@@ -627,22 +627,15 @@
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;
More information about the llvm-commits
mailing list