Don't insert scales of 1 :)

llvm-svn: 1430
This commit is contained in:
Chris Lattner 2001-12-07 04:26:02 +00:00
parent a57615faaa
commit 72da4460b3
1 changed files with 2 additions and 1 deletions

View 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);