aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp6
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,