summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-07-23 15:22:26 +0000
committerChris Lattner <sabre@nondot.org>2003-07-23 15:22:26 +0000
commit6077c3195f74b27b75ed3e9df3af7a13798b437f (patch)
tree48a5a2e54b7d1a5762d782e838db817d8a2e78ca /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parent79f22fe02fe354c50fc4d6a1c08a894fdd847dba (diff)
downloadbcm5719-llvm-6077c3195f74b27b75ed3e9df3af7a13798b437f.tar.gz
bcm5719-llvm-6077c3195f74b27b75ed3e9df3af7a13798b437f.zip
Simplify code by using ConstantInt::getRawValue instead of checking to see
whether the constant is signed or unsigned, then casting llvm-svn: 7252
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