summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Analysis/MustExecute/loop-header.ll49
1 files changed, 28 insertions, 21 deletions
diff --git a/llvm/test/Analysis/MustExecute/loop-header.ll b/llvm/test/Analysis/MustExecute/loop-header.ll
index a505e85efa8..b74c3e2a317 100644
--- a/llvm/test/Analysis/MustExecute/loop-header.ll
+++ b/llvm/test/Analysis/MustExecute/loop-header.ll
@@ -1,12 +1,14 @@
-; RUN: opt -analyze -print-mustexecute %s
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -disable-output -print-mustexecute %s 2>&1 | FileCheck %s
-; CHECK: Printing analysis 'Instructions which execute on loop entry' for function 'header_with_icf':
-; CHECK: The following are guaranteed to execute (for the respective loops):
-; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ] (mustexec in: loop)
-; CHECK: %v = load i32, i32* %p (mustexec in: loop)
-; CHECK: call void @maythrow_and_use(i32 %v) (mustexec in: loop)
-; CHECK-NOT: add
define i1 @header_with_icf(i32* noalias %p, i32 %high) {
+; CHECK-LABEL: @header_with_icf(
+; CHECK-LABEL: loop:
+; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ] ; (mustexec in: loop)
+; CHECK: %v = load i32, i32* %p ; (mustexec in: loop)
+; CHECK: call void @maythrow_and_use(i32 %v) ; (mustexec in: loop)
+; CHECK-NOT: mustexec
+
entry:
br label %loop
@@ -22,12 +24,13 @@ exit:
ret i1 false
}
-; CHECK: Printing analysis 'Instructions which execute on loop entry' for function 'test':
-; CHECK: The following are guaranteed to execute (for the respective loops):
-; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] (mustexec in: loop)
-; CHECK: %v = load i32, i32* %p (mustexec in: loop)
-; CHECK: br label %next (mustexec in: loop)
-define i1 @test(i32* noalias %p, i32 %high) {
+define i1 @split_header(i32* noalias %p, i32 %high) {
+; CHECK-LABEL: @split_header(
+; CHECK-LABEL: loop:
+; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
+; CHECK: %v = load i32, i32* %p ; (mustexec in: loop)
+; CHECK: br label %next ; (mustexec in: loop)
+; CHECK-NOT: mustexec
entry:
br label %loop
@@ -45,15 +48,19 @@ exit:
ret i1 false
}
-; CHECK: Printing analysis 'Instructions which execute on loop entry' for function 'nested':
-; CHECK: The following are guaranteed to execute (for the respective loops):
-; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] (mustexec in: loop)
-; CHECK: br label %inner_loop (mustexec in: loop)
-; FIXME: These three are also must execute for the outer loop.
-; CHECK: %v = load i32, i32* %p (mustexec in: inner_loop)
-; CHECK: %inner.test = icmp eq i32 %v, 0 (mustexec in: inner_loop)
-; CHECK: br i1 %inner.test, label %inner_loop, label %next (mustexec in: inner_loop)
+; FIXME: everything in inner loop header should be must execute
+; for outer as well
define i1 @nested(i32* noalias %p, i32 %high) {
+; CHECK-LABEL: @nested
+; CHECK-LABEL: loop: ; preds = %next
+; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
+; CHECK: br label %inner_loop ; (mustexec in: loop)
+; CHECK-LABEL: inner_loop:
+; CHECK: %v = load i32, i32* %p ; (mustexec in: inner_loop)
+; CHECK: %inner.test = icmp eq i32 %v, 0 ; (mustexec in: inner_loop)
+; CHECK: br i1 %inner.test, label %inner_loop, label %next ; (mustexec in: inner_loop)
+; CHECK-NOT: mustexec
+
entry:
br label %loop
OpenPOWER on IntegriCloud