Mark the increments of the generated induction variables 'NSW'
authorTobias Grosser <grosser@fim.uni-passau.de>
Tue, 29 May 2012 09:11:59 +0000 (09:11 +0000)
committerTobias Grosser <grosser@fim.uni-passau.de>
Tue, 29 May 2012 09:11:59 +0000 (09:11 +0000)
In general, all code that we produce is NSW.

llvm-svn: 157606

polly/lib/CodeGen/LoopGenerators.cpp

index f56ec41..3688898 100644 (file)
@@ -53,7 +53,7 @@ Value *polly::createLoop(Value *LB, Value *UB, Value *Stride,
   IV->addIncoming(LB, PreheaderBB);
 
   Stride = Builder.CreateZExtOrBitCast(Stride, LoopIVType);
-  Value *IncrementedIV = Builder.CreateAdd(IV, Stride, "polly.next_loopiv");
+  Value *IncrementedIV = Builder.CreateNSWAdd(IV, Stride, "polly.next_loopiv");
 
   // Exit condition.
   Value *CMP;