diff options
author | Chris Lattner <sabre@nondot.org> | 2011-04-17 20:23:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-04-17 20:23:29 +0000 |
commit | b53ccb8e36fcb68fb87043db032046f34b66c76f (patch) | |
tree | 611e5a12eb552c745602f87011bfb13853bf430e /llvm/utils/TableGen/FastISelEmitter.cpp | |
parent | a9e411799150038f39496a2978bbb5152a60fe47 (diff) | |
download | bcm5719-llvm-b53ccb8e36fcb68fb87043db032046f34b66c76f.tar.gz bcm5719-llvm-b53ccb8e36fcb68fb87043db032046f34b66c76f.zip |
1. merge fast-isel-shift-imm.ll into fast-isel-x86-64.ll
2. implement rdar://9289501 - fast isel should fold trivial multiplies to shifts
3. teach tblgen to handle shift immediates that are different sizes than the
shifted operands, eliminating some code from the X86 fast isel backend.
4. Have FastISel::SelectBinaryOp use (the poorly named) FastEmit_ri_ function
instead of FastEmit_ri to simplify code.
llvm-svn: 129666
Diffstat (limited to 'llvm/utils/TableGen/FastISelEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/FastISelEmitter.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/llvm/utils/TableGen/FastISelEmitter.cpp b/llvm/utils/TableGen/FastISelEmitter.cpp index f01de1dcfce..b6631c848e0 100644 --- a/llvm/utils/TableGen/FastISelEmitter.cpp +++ b/llvm/utils/TableGen/FastISelEmitter.cpp @@ -52,8 +52,7 @@ struct OperandsSignature { /// of the Operands array accordingly. Return true if all the operands /// are supported, false otherwise. /// - bool initialize(TreePatternNode *InstPatNode, - const CodeGenTarget &Target, + bool initialize(TreePatternNode *InstPatNode, const CodeGenTarget &Target, MVT::SimpleValueType VT) { if (!InstPatNode->isLeaf()) { @@ -74,13 +73,7 @@ struct OperandsSignature { // For now, filter out any operand with a predicate. // For now, filter out any operand with multiple values. - if (!Op->getPredicateFns().empty() || - Op->getNumTypes() != 1) - return false; - - assert(Op->hasTypeSet(0) && "Type infererence not done?"); - // For now, all the operands must have the same type. - if (Op->getType(0) != VT) + if (!Op->getPredicateFns().empty() || Op->getNumTypes() != 1) return false; if (!Op->isLeaf()) { @@ -95,6 +88,15 @@ struct OperandsSignature { // For now, ignore other non-leaf nodes. return false; } + + assert(Op->hasTypeSet(0) && "Type infererence not done?"); + + // For now, all the operands must have the same type (if they aren't + // immediates). Note that this causes us to reject variable sized shifts + // on X86. + if (Op->getType(0) != VT) + return false; + DefInit *OpDI = dynamic_cast<DefInit*>(Op->getLeafValue()); if (!OpDI) return false; @@ -321,6 +323,11 @@ void FastISelMap::CollectPatterns(CodeGenDAGPatterns &CGP) { assert(InstPatNode->getChild(0)->getNumTypes() == 1); VT = InstPatNode->getChild(0)->getType(0); } + + if (InstPatOp->getName() =="shl") { + InstPatNode->dump(); + } + // For now, filter out instructions which just set a register to // an Operand or an immediate, like MOV32ri. |