diff options
author | Chris Lattner <sabre@nondot.org> | 2003-11-05 17:31:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-11-05 17:31:36 +0000 |
commit | 1bcc70d240edabb41dc74214f21ee86240ee68fb (patch) | |
tree | 7482f3a046309a63104d5094c76f9ba1bd1b28b2 /lib/Transforms | |
parent | 7f1affe677edf5407530e31b5a2d82d713627441 (diff) |
Fix flawed logic that was breaking several SPEC benchmarks, including gzip and crafty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 4a5f1fbcfc..07736b57c2 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -1337,8 +1337,8 @@ Instruction *InstCombiner::visitSetCondInst(BinaryOperator &I) { // because the source would be zero extended. unsigned SrcBits = SrcTy == Type::BoolTy ? 1 : SrcTy->getPrimitiveSize()*8; - bool HasSignBit = 1ULL << (DestTy->getPrimitiveSize()*8-1); - if (ConstVal & ((1ULL << SrcBits)-1)) { + bool HasSignBit = ConstVal & (1ULL << (DestTy->getPrimitiveSize()*8-1)); + if (ConstVal & ~((1ULL << SrcBits)-1)) { switch (I.getOpcode()) { default: assert(0 && "Unknown comparison type!"); case Instruction::SetEQ: @@ -1655,7 +1655,7 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) { unsigned AllocElTySize = TD->getTypeSize(AllocElTy); const Type *CastElTy = PTy->getElementType(); unsigned CastElTySize = TD->getTypeSize(CastElTy); - + // If the allocation is for an even multiple of the cast type size if (CastElTySize && (AllocElTySize % CastElTySize == 0)) { Value *Amt = ConstantUInt::get(Type::UIntTy, |