ret i1 false
}
+; Since all the instructions in the loop dominate the only exit
+; and there's no implicit control flow in the loop, all must execute
+; FIXME: handled by loop safety info, test it
+define i1 @nothrow_loop(i32* noalias %p, i32 %high) {
+; CHECK-LABEL: @nothrow_loop(
+; CHECK-LABEL: loop:
+; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
+; CHECK: br label %next ; (mustexec in: loop)
+; CHECK-NOT: mustexec
+
+entry:
+ br label %loop
+
+loop:
+ %iv = phi i32 [0, %entry], [%iv.next, %next]
+ br label %next
+next:
+ %v = load i32, i32* %p
+ %iv.next = add nsw nuw i32 %iv, 1
+ %exit.test = icmp slt i32 %iv, %high
+ br i1 %exit.test, label %exit, label %loop
+
+exit:
+ ret i1 false
+}
+
declare void @maythrow_and_use(i32)