aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index adcd339f27..fac659f39b 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -388,7 +388,8 @@ static bool ValueRequiresCast(const Value *V, const Type *Ty, TargetData *TD) {
// If this is another cast that can be eliminated, it isn't codegen either.
if (const CastInst *CI = dyn_cast<CastInst>(V))
- if (isEliminableCastPair(CI, CastInst::getCastOpcode(V, Ty), Ty, TD))
+ if (isEliminableCastPair(CI, CastInst::getCastOpcode(
+ V, V->getType()->isSigned(), Ty, Ty->isSigned()), Ty, TD))
return false;
return true;
}