Fix bug that caused invalid transformations to be applied
authorChris Lattner <sabre@nondot.org>
Thu, 6 Dec 2001 18:05:55 +0000 (18:05 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 6 Dec 2001 18:05:55 +0000 (18:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1426 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/TransformInternals.cpp

index c12fe6930faa1eb05d6eb9e3577e29fe9fb9c197..e46eaf4d11dfe0d550ad7ff4a5f9a4f549239f8b 100644 (file)
@@ -203,7 +203,7 @@ const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal,
             Expr.Var = IdxCast;
           }
 
-          if (Scale > ElSize) {  // If we have to scale up our index, do so now
+          if (ScaleAmt) {         // 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);