aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 4aab096335..e029f7a657 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);
}