summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/IRCE/single-access-with-preloop.ll
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-02-21 22:07:32 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-02-21 22:07:32 +0000
commit7fc60da2f58fed58a60046e4da815646a6b83c61 (patch)
treebc91e2465cbdd4543a986531461573ef8aa34e74 /llvm/test/Transforms/IRCE/single-access-with-preloop.ll
parentf07833057c012ca19d173f1e4990d8fa3ccda6cb (diff)
downloadbcm5719-llvm-7fc60da2f58fed58a60046e4da815646a6b83c61.tar.gz
bcm5719-llvm-7fc60da2f58fed58a60046e4da815646a6b83c61.zip
IRCE: use SCEVs instead of llvm::Value's for intermediate
calculations. Semantically non-functional change. This gets rid of some of the SCEV -> Value -> SCEV round tripping and the Construct(SMin|SMax)Of and MaybeSimplify helper routines. llvm-svn: 230150
Diffstat (limited to 'llvm/test/Transforms/IRCE/single-access-with-preloop.ll')
-rw-r--r--llvm/test/Transforms/IRCE/single-access-with-preloop.ll16
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/test/Transforms/IRCE/single-access-with-preloop.ll b/llvm/test/Transforms/IRCE/single-access-with-preloop.ll
index dacf697e98a..c220efa50a6 100644
--- a/llvm/test/Transforms/IRCE/single-access-with-preloop.ll
+++ b/llvm/test/Transforms/IRCE/single-access-with-preloop.ll
@@ -29,12 +29,16 @@ define void @single_access_with_preloop(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32
}
; CHECK-LABEL: loop.preheader:
-; CHECK: [[safe_start:[^ ]+]] = sub i32 0, %offset
-; CHECK: [[safe_end:[^ ]+]] = sub i32 %len, %offset
-; CHECK: [[exit_preloop_at_cond:[^ ]+]] = icmp slt i32 %n, [[safe_start]]
-; CHECK: [[exit_preloop_at:[^ ]+]] = select i1 [[exit_preloop_at_cond]], i32 %n, i32 [[safe_start]]
-; CHECK: [[exit_mainloop_at_cond:[^ ]+]] = icmp slt i32 %n, [[safe_end]]
-; CHECK: [[exit_mainloop_at:[^ ]+]] = select i1 [[exit_mainloop_at_cond]], i32 %n, i32 [[safe_end]]
+; CHECK: [[not_safe_start:[^ ]+]] = add i32 %offset, -1
+; CHECK: [[not_n:[^ ]+]] = sub i32 -1, %n
+; CHECK: [[not_exit_preloop_at_cond:[^ ]+]] = icmp sgt i32 [[not_safe_start]], [[not_n]]
+; CHECK: [[not_exit_preloop_at:[^ ]+]] = select i1 [[not_exit_preloop_at_cond]], i32 [[not_safe_start]], i32 [[not_n]]
+; CHECK: [[exit_preloop_at:[^ ]+]] = sub i32 -1, [[not_exit_preloop_at]]
+
+; CHECK: [[not_safe_end:[^ ]+]] = sub i32 [[not_safe_start]], %len
+; CHECK: [[not_exit_mainloop_at_cond:[^ ]+]] = icmp sgt i32 [[not_safe_end]], [[not_n]]
+; CHECK: [[not_exit_mainloop_at:[^ ]+]] = select i1 [[not_exit_mainloop_at_cond]], i32 [[not_safe_end]], i32 [[not_n]]
+; CHECK: [[exit_mainloop_at:[^ ]+]] = sub i32 -1, [[not_exit_mainloop_at]]
; CHECK-LABEL: in.bounds:
; CHECK: [[continue_mainloop_cond:[^ ]+]] = icmp slt i32 %idx.next, [[exit_mainloop_at]]
OpenPOWER on IntegriCloud