summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 0ecec730d90..33de49d391d 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -370,8 +370,7 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
if (Constant *Op1 = dyn_cast<Constant>(I.getOperand(1))) {
if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) {
const Type *Ty = CI->getType();
- int64_t Val = Ty->isSigned() ? cast<ConstantSInt>(CI)->getValue() :
- (int64_t)cast<ConstantUInt>(CI)->getValue();
+ int64_t Val = (int64_t)cast<ConstantInt>(CI)->getRawValue();
switch (Val) {
case -1: // X * -1 -> -X
return BinaryOperator::createNeg(Op0, I.getName());
OpenPOWER on IntegriCloud