Fix bug: 2002-10-02-SignExtensionProblem.ll
authorChris Lattner <sabre@nondot.org>
Wed, 2 Oct 2002 18:53:14 +0000 (18:53 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 2 Oct 2002 18:53:14 +0000 (18:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4017 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/TransformInternals.cpp

index 3e334eb5ebb00e0a8a563197ff94bcfefe7dd787..51d5ff54c2b741fb6d72b5498997addb7a59782f 100644 (file)
@@ -147,15 +147,14 @@ const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal,
 
           if (ScaleAmt && ScaleAmt != 1) {
             // If we have to scale up our index, do so now
-            Value *ScaleAmtVal = ConstantSInt::get(Type::LongTy,
-                                                   (unsigned)ScaleAmt);
+            Value *ScaleAmtVal = ConstantSInt::get(Type::LongTy, ScaleAmt);
             Expr.Var = BinaryOperator::create(Instruction::Mul, Expr.Var,
                                               ScaleAmtVal,
                                               Expr.Var->getName()+"-scale",*BI);
           }
 
           if (Index) {  // Add an offset to the index
-            Value *IndexAmt = ConstantSInt::get(Type::LongTy, (unsigned)Index);
+            Value *IndexAmt = ConstantSInt::get(Type::LongTy, Index);
             Expr.Var = BinaryOperator::create(Instruction::Add, Expr.Var,
                                               IndexAmt,
                                               Expr.Var->getName()+"-offset",