Add support for fast isel of (integer) immediate materialization pattens, and use them to support
bitcast of constants in fast isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55325 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/FastISelEmitter.cpp b/utils/TableGen/FastISelEmitter.cpp
index 5868a24..f730f1d 100644
--- a/utils/TableGen/FastISelEmitter.cpp
+++ b/utils/TableGen/FastISelEmitter.cpp
@@ -64,6 +64,12 @@
const CodeGenTarget &Target,
MVT::SimpleValueType VT,
const CodeGenRegisterClass *DstRC) {
+ if (!InstPatNode->isLeaf() &&
+ InstPatNode->getOperator()->getName() == "imm") {
+ Operands.push_back("i");
+ return true;
+ }
+
for (unsigned i = 0, e = InstPatNode->getNumChildren(); i != e; ++i) {
TreePatternNode *Op = InstPatNode->getChild(i);
// For now, filter out any operand with a predicate.
@@ -219,9 +225,6 @@
// an Operand or an immediate, like MOV32ri.
if (InstPatOp->isSubClassOf("Operand"))
continue;
- if (InstPatOp->getName() == "imm" ||
- InstPatOp->getName() == "fpimm")
- continue;
// For now, filter out any instructions with predicates.
if (!InstPatNode->getPredicateFn().empty())