aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-10-26 16:59:37 +0000
committerChris Lattner <sabre@nondot.org>2005-10-26 16:59:37 +0000
commit1531f2025c9054c02cfb84bd2485b04cc72591c6 (patch)
treea28f8dc13b720f868f682e755018bd8f80a35922
parent61b42eb928dd4f042ed4444c0a5497d6ef7d527d (diff)
downloadexternal_llvm-1531f2025c9054c02cfb84bd2485b04cc72591c6.zip
external_llvm-1531f2025c9054c02cfb84bd2485b04cc72591c6.tar.gz
external_llvm-1531f2025c9054c02cfb84bd2485b04cc72591c6.tar.bz2
Add support for CondCode's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24008 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index 32f0e64..522267d 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -291,8 +291,13 @@ bool TreePatternNode::UpdateNodeType(unsigned char VT, TreePattern &TP) {
return true;
}
- TP.error("Type inference contradiction found in node " +
- getOperator()->getName() + "!");
+ if (isLeaf()) {
+ dump();
+ TP.error("Type inference contradiction found in node!");
+ } else {
+ TP.error("Type inference contradiction found in node " +
+ getOperator()->getName() + "!");
+ }
return true; // unreachable
}
@@ -466,8 +471,8 @@ static unsigned char getIntrinsicType(Record *R, bool NotRegisters,
// TODO: if a register appears in exactly one regclass, we could use that
// type info.
return MVT::isUnknown;
- } else if (R->isSubClassOf("ValueType")) {
- // Using a VTSDNode.
+ } else if (R->isSubClassOf("ValueType") || R->isSubClassOf("CondCode")) {
+ // Using a VTSDNode or CondCodeSDNode.
return MVT::Other;
} else if (R->getName() == "node") {
// Placeholder.
@@ -1582,6 +1587,11 @@ void DAGISelEmitter::EmitMatchForPattern(TreePatternNode *N,
OS << " if (cast<VTSDNode>(" << RootName << i << ")->getVT() != "
<< "MVT::" << LeafRec->getName() << ") goto P" << PatternNo
<< "Fail;\n";
+ } else if (LeafRec->isSubClassOf("CondCode")) {
+ // Make sure this is the specified cond code.
+ OS << " if (cast<CondCodeSDNode>(" << RootName << i
+ << ")->get() != " << "MVT::" << LeafRec->getName()
+ << ") goto P" << PatternNo << "Fail;\n";
} else {
Child->dump();
assert(0 && "Unknown leaf type!");