diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-08-21 16:28:22 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-08-21 16:28:22 +0000 |
| commit | 7e09f13fed6fa16e71f4a24c1531e825ede54d32 (patch) | |
| tree | d10c39831aab90dd6ae001895f81e03444c36440 /llvm/lib | |
| parent | 67e7e224623b1d756cd037207a6b191a67775ff5 (diff) | |
| download | bcm5719-llvm-7e09f13fed6fa16e71f4a24c1531e825ede54d32.tar.gz bcm5719-llvm-7e09f13fed6fa16e71f4a24c1531e825ede54d32.zip | |
[InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat constant vectors, part 2
This is a partial enablement (move the ConstantInt guard down).
llvm-svn: 279398
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 220d783b058..73dc141d97e 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2024,16 +2024,16 @@ Instruction *InstCombiner::foldICmpShlConstant(ICmpInst &Cmp, Instruction *Shl, } } - // FIXME: This check restricts all folds under here to scalar types. - ConstantInt *RHS = dyn_cast<ConstantInt>(Cmp.getOperand(1)); - if (!RHS) - return nullptr; - // If this is a signed comparison to 0 and the shift is sign preserving, // use the shift LHS operand instead; isSignTest may change 'Pred', so only // do that if we're sure to not continue on in this function. if (cast<BinaryOperator>(Shl)->hasNoSignedWrap() && isSignTest(Pred, *C)) - return new ICmpInst(Pred, X, Constant::getNullValue(RHS->getType())); + return new ICmpInst(Pred, X, Constant::getNullValue(X->getType())); + + // FIXME: This check restricts all folds under here to scalar types. + ConstantInt *RHS = dyn_cast<ConstantInt>(Cmp.getOperand(1)); + if (!RHS) + return nullptr; // Otherwise, if this is a comparison of the sign bit, simplify to and/test. bool TrueIfSigned = false; |

