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 | 2fcb26cc756386813256d37a3a2fcc231e412477 (patch) | |
tree | 4d16332081497d4461b0ec001c9f7e5e0ab01764 /llvm/lib | |
parent | f023db644492337f13d36cad3cbce12f76d8113f (diff) | |
download | bcm5719-llvm-2fcb26cc756386813256d37a3a2fcc231e412477.tar.gz bcm5719-llvm-2fcb26cc756386813256d37a3a2fcc231e412477.zip |
Don't apply this transform to vectors. Fixes PR2756.
llvm-svn: 55690
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 17c0750346a..aedad72037e 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/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: |