From: Chris Lattner Date: Fri, 7 Dec 2001 04:26:02 +0000 (+0000) Subject: Don't insert scales of 1 :) X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7c3f415d99908a515ecc1e82a3fb946acee2c6ac;p=oota-llvm.git Don't insert scales of 1 :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1430 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/TransformInternals.cpp b/lib/Transforms/TransformInternals.cpp index e46eaf4d11d..63368d55a1d 100644 --- a/lib/Transforms/TransformInternals.cpp +++ b/lib/Transforms/TransformInternals.cpp @@ -203,7 +203,8 @@ const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal, Expr.Var = IdxCast; } - if (ScaleAmt) { // If we have to scale up our index, do so now + if (ScaleAmt && ScaleAmt != 1) { + // If we have to scale up our index, do so now Value *ScaleAmtVal = ConstantUInt::get(Type::UIntTy, ScaleAmt); Instruction *Scaler = BinaryOperator::create(Instruction::Mul, Expr.Var,ScaleAmtVal);