diff options
author | czhengsz <czhengsz@cn.ibm.com> | 2019-12-19 04:11:45 -0500 |
---|---|---|
committer | czhengsz <czhengsz@cn.ibm.com> | 2019-12-19 04:11:45 -0500 |
commit | d588a00206ac12ea87fe52ffe1f5e972f0a06cce (patch) | |
tree | 7ef5c6b7b468d0cad7932e72627e8664d5f30abd /llvm/test/Analysis | |
parent | 18188a7f44506892a2f4be4100d66971f18000ec (diff) | |
download | bcm5719-llvm-d588a00206ac12ea87fe52ffe1f5e972f0a06cce.tar.gz bcm5719-llvm-d588a00206ac12ea87fe52ffe1f5e972f0a06cce.zip |
[SCEV] NFC - add testcase for get accurate range for AddExpr
Diffstat (limited to 'llvm/test/Analysis')
-rw-r--r-- | llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll b/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll new file mode 100644 index 00000000000..c5640bf6dda --- /dev/null +++ b/llvm/test/Analysis/ScalarEvolution/range_nw_flag.ll @@ -0,0 +1,21 @@ +; RUN: opt < %s -S -analyze -scalar-evolution | FileCheck %s + +; copied from flags-from-poison.ll +; CHECK-LABEL: @test-add-nuw +; CHECK: --> {(1 + %offset)<nuw>,+,1}<nuw><%loop> U: full-set S: full-set +define void @test-add-nuw(float* %input, i32 %offset, i32 %numIterations) { +entry: + br label %loop +loop: + %i = phi i32 [ %nexti, %loop ], [ 0, %entry ] + %nexti = add nuw i32 %i, 1 + %index32 = add nuw i32 %nexti, %offset + %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 +} + |