Add support for CondCode's

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24008 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-10-26 16:59:37 +00:00
parent 61b42eb928
commit 1531f2025c

View File

@ -291,8 +291,13 @@ bool TreePatternNode::UpdateNodeType(unsigned char VT, TreePattern &TP) {
return true; return true;
} }
TP.error("Type inference contradiction found in node " + if (isLeaf()) {
getOperator()->getName() + "!"); dump();
TP.error("Type inference contradiction found in node!");
} else {
TP.error("Type inference contradiction found in node " +
getOperator()->getName() + "!");
}
return true; // unreachable 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 // TODO: if a register appears in exactly one regclass, we could use that
// type info. // type info.
return MVT::isUnknown; return MVT::isUnknown;
} else if (R->isSubClassOf("ValueType")) { } else if (R->isSubClassOf("ValueType") || R->isSubClassOf("CondCode")) {
// Using a VTSDNode. // Using a VTSDNode or CondCodeSDNode.
return MVT::Other; return MVT::Other;
} else if (R->getName() == "node") { } else if (R->getName() == "node") {
// Placeholder. // Placeholder.
@ -1582,6 +1587,11 @@ void DAGISelEmitter::EmitMatchForPattern(TreePatternNode *N,
OS << " if (cast<VTSDNode>(" << RootName << i << ")->getVT() != " OS << " if (cast<VTSDNode>(" << RootName << i << ")->getVT() != "
<< "MVT::" << LeafRec->getName() << ") goto P" << PatternNo << "MVT::" << LeafRec->getName() << ") goto P" << PatternNo
<< "Fail;\n"; << "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 { } else {
Child->dump(); Child->dump();
assert(0 && "Unknown leaf type!"); assert(0 && "Unknown leaf type!");