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 :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23815 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-10-19 02:07:26 +00:00
parent ab1bf27be5
commit 4c59309f59

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;