diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2008-09-03 06:24:21 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2008-09-03 06:24:21 +0000 |
commit | 23c04309fb3811499fec21498f7926b89b82d401 (patch) | |
tree | 472282d86d4ef1bac7285c7c1592b7f231b949d2 /lib | |
parent | 83c05e5d30366d7c7e3d08e886dee89b1320ae7a (diff) | |
download | llvm-23c04309fb3811499fec21498f7926b89b82d401.tar.gz llvm-23c04309fb3811499fec21498f7926b89b82d401.tar.bz2 llvm-23c04309fb3811499fec21498f7926b89b82d401.tar.xz |
Don't apply this transform to vectors. Fixes PR2756.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55690 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 17c0750346..aedad72037 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2948,8 +2948,9 @@ Instruction *InstCombiner::visitSRem(BinaryOperator &I) { return common; if (Value *RHSNeg = dyn_castNegVal(Op1)) - if (!isa<ConstantInt>(RHSNeg) || - cast<ConstantInt>(RHSNeg)->getValue().isStrictlyPositive()) { + if (!isa<Constant>(RHSNeg) || + (isa<ConstantInt>(RHSNeg) && + cast<ConstantInt>(RHSNeg)->getValue().isStrictlyPositive())) { // X % -Y -> X % Y AddUsesToWorkList(I); I.setOperand(1, RHSNeg); @@ -5495,7 +5496,7 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { if (Op0I->getOpcode() == Op1I->getOpcode() && Op0I->hasOneUse() && Op1I->hasOneUse() && Op0I->getOperand(1) == Op1I->getOperand(1) && I.isEquality()) { - switch (Op0I->getOpcode()) { + switch (Op0I->getOpcode()) { default: break; case Instruction::Add: case Instruction::Sub: |