[llvm] 4ebb589 - [SCEV] [NFC] add testcase for constant range for addrecexpr with nsw flag
Zheng Chen via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 8 22:27:17 PST 2020
Author: Zheng Chen
Date: 2020-01-09T01:26:57-05:00
New Revision: 4ebb589629b0d3de0827cab179338836ebb3a8b6
URL: https://github.com/llvm/llvm-project/commit/4ebb589629b0d3de0827cab179338836ebb3a8b6
DIFF: https://github.com/llvm/llvm-project/commit/4ebb589629b0d3de0827cab179338836ebb3a8b6.diff
LOG: [SCEV] [NFC] add testcase for constant range for addrecexpr with nsw flag
Added:
Modified:
llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll b/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll
index 65ecd312e0cb..4a520056d765 100644
--- a/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll
+++ b/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll
@@ -39,3 +39,22 @@ exit:
ret void
}
+; CHECK-LABEL: @test-addrec-nsw
+; CHECK: --> {(-1 + (-10 smin %offset))<nsw>,+,-1}<nsw><%loop> U: [-2147483648,1) S: [-2147483648,1)
+define void @test-addrec-nsw(float* %input, i32 %offset, i32 %numIterations) {
+entry:
+ %cmp = icmp slt i32 %offset, -10
+ %max = select i1 %cmp, i32 %offset, i32 -10
+ br label %loop
+loop:
+ %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
+ %nexti = add nsw i32 %i, -1
+ %index32 = add nsw i32 %nexti, %max
+ %ptr = getelementptr inbounds float, float* %input, i32 %index32
+ %f = load float, float* %ptr, align 4
+ %exitcond = icmp eq i32 %nexti, %numIterations
+ br i1 %exitcond, label %exit, label %loop
+
+exit:
+ ret void
+}
More information about the llvm-commits
mailing list