Don't insert scales of 1 :)
authorChris Lattner <sabre@nondot.org>
Fri, 7 Dec 2001 04:26:02 +0000 (04:26 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 7 Dec 2001 04:26:02 +0000 (04:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1430 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/TransformInternals.cpp

index e46eaf4d11dfe0d550ad7ff4a5f9a4f549239f8b..63368d55a1d302d288d2d36bf671a710688ae40b 100644 (file)
@@ -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);