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 | 602fc0681726155942907debee1fe0b8b44ffc1b (patch) | |
tree | 0bfeace2cbb88ef3fe10b95a0a513543aa490a12 /utils | |
parent | 0a1c997c27706e315efb61b8b3e110d42cbaae64 (diff) | |
download | llvm-602fc0681726155942907debee1fe0b8b44ffc1b.tar.gz llvm-602fc0681726155942907debee1fe0b8b44ffc1b.tar.bz2 llvm-602fc0681726155942907debee1fe0b8b44ffc1b.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/FastISelEmitter.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/utils/TableGen/FastISelEmitter.cpp b/utils/TableGen/FastISelEmitter.cpp index f01de1dcfc..b6631c848e 100644 --- a/utils/TableGen/FastISelEmitter.cpp +++ b/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. |