aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-21 06:42:58 +0000
committerChris Lattner <sabre@nondot.org>2006-03-21 06:42:58 +0000
commit4e2f54d99e551832355e5e7c28111c7664b11de5 (patch)
treeb6ee1a4573156c68df0baff5851177724eab0643
parent8151914321a67b16d7183248593171e670a28e4c (diff)
minor code simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26918 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index d1651b4e65..dc170a57bc 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -698,17 +698,11 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
if (getNumChildren() != 1)
TP.error("Node transform '" + getOperator()->getName() +
"' requires one operand!");
- unsigned char ExtType0 = getExtTypeNum(0);
- unsigned char ChildExtType0 = getChild(0)->getExtTypeNum(0);
- if (ExtType0 == MVT::isInt ||
- ExtType0 == MVT::isFP ||
- ExtType0 == MVT::isUnknown ||
- ChildExtType0 == MVT::isInt ||
- ChildExtType0 == MVT::isFP ||
- ChildExtType0 == MVT::isUnknown) {
- // If either the output or input of the xform does not have exact
- // type info. We assume they must be the same. Otherwise, it is perfectly
- // legal to transform from one type to a completely different type.
+
+ // If either the output or input of the xform does not have exact
+ // type info. We assume they must be the same. Otherwise, it is perfectly
+ // legal to transform from one type to a completely different type.
+ if (!hasTypeSet() || !getChild(0)->hasTypeSet()) {
bool MadeChange = UpdateNodeType(getChild(0)->getExtTypes(), TP);
MadeChange |= getChild(0)->UpdateNodeType(getExtTypes(), TP);
return MadeChange;