aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 4aab096..e029f7a 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -3862,7 +3862,7 @@ Instruction *InstCombiner::PromoteCastOfAllocation(CastInst &CI,
Amt = ConstantUInt::get(Type::UIntTy, Scale);
if (ConstantUInt *CI = dyn_cast<ConstantUInt>(NumElements))
Amt = ConstantExpr::getMul(CI, cast<ConstantUInt>(Amt));
- else if (cast<ConstantUInt>(Amt)->getValue() == 1) {
+ else if (Scale != 1) {
Instruction *Tmp = BinaryOperator::createMul(Amt, NumElements, "tmp");
Amt = InsertNewInstBefore(Tmp, AI);
}