Add support for patterns that have physical registers in them. Testcase:

def : Pat<(trunc G8RC:$in),
          (OR8To4 G8RC:$in, X0)>;

Even though this doesn't make any sense on PPC :)

llvm-svn: 23815
This commit is contained in:
Chris Lattner 2005-10-19 02:07:26 +00:00
parent c8f899f98d
commit b8014e10ae
1 changed files with 12 additions and 0 deletions

View File

@ -1617,6 +1617,18 @@ CodeGenPatternResult(TreePatternNode *N, unsigned &Ctr,
}
if (N->isLeaf()) {
// If this is an explicit register reference, handle it.
if (DefInit *DI = dynamic_cast<DefInit*>(N->getLeafValue())) {
unsigned ResNo = Ctr++;
if (DI->getDef()->isSubClassOf("Register")) {
OS << " SDOperand Tmp" << ResNo << " = CurDAG->getRegister("
<< getQualifiedName(DI->getDef()) << ", MVT::"
<< getEnumName(N->getType())
<< ");\n";
return ResNo;
}
}
N->dump();
assert(0 && "Unknown leaf type!");
return ~0U;