When lowering an inbounds gep, the intermediate adds can have
[oota-llvm.git] / lib / Transforms / InstCombine / InstCombineAddSub.cpp
index b04a05b3b358399fcd7a4bd2946b38a2b20ab41b..4ff005e26c28eb2a26984f0ee297a7d37d7ee584 100644 (file)
@@ -420,8 +420,7 @@ Value *InstCombiner::EmitGEPOffset(User *GEP) {
         
         if (Size)
           Result = Builder->CreateAdd(Result, ConstantInt::get(IntPtrTy, Size),
-                                      GEP->getName()+".offs",
-                                      isInBounds /*NUW*/);
+                                      GEP->getName()+".offs");
         continue;
       }
       
@@ -430,8 +429,7 @@ Value *InstCombiner::EmitGEPOffset(User *GEP) {
               ConstantExpr::getIntegerCast(OpC, IntPtrTy, true /*SExt*/);
       Scale = ConstantExpr::getMul(OC, Scale, isInBounds/*NUW*/);
       // Emit an add instruction.
-      Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs",
-                                  isInBounds /*NUW*/);
+      Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs");
       continue;
     }
     // Convert to correct type.
@@ -444,8 +442,7 @@ Value *InstCombiner::EmitGEPOffset(User *GEP) {
     }
 
     // Emit an add instruction.
-    Result = Builder->CreateAdd(Op, Result, GEP->getName()+".offs",
-                                isInBounds /*NUW*/);
+    Result = Builder->CreateAdd(Op, Result, GEP->getName()+".offs");
   }
   return Result;
 }