From 325231c925a5f80c3e41635762547d80affecff3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 28 Oct 2005 16:27:35 +0000 Subject: [PATCH] Fix a bit of backwards logic that broke exptree and smg2000 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24056 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 4aab0963352..e029f7a6571 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(NumElements)) Amt = ConstantExpr::getMul(CI, cast(Amt)); - else if (cast(Amt)->getValue() == 1) { + else if (Scale != 1) { Instruction *Tmp = BinaryOperator::createMul(Amt, NumElements, "tmp"); Amt = InsertNewInstBefore(Tmp, AI); } -- 2.34.1