1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes='loop(simple-loop-unswitch<nontrivial>),verify<loops>' -S < %s | FileCheck %s
3 ; RUN: opt -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -S < %s | FileCheck %s
4 ; RUN: opt -passes='simple-loop-unswitch<nontrivial>' -verify-memoryssa -verify-loop-info -S < %s | FileCheck %s
7 declare void @llvm.experimental.guard(i1, ...)
10 define void @foo(ptr addrspace(1) %arg, i64 %arg1) personality ptr @pluto {
13 ; CHECK-NEXT: [[TMP:%.*]] = icmp slt i32 poison, 570
14 ; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[TMP]], i1 true, i1 false
15 ; CHECK-NEXT: br i1 [[TMP]], label [[BB_SPLIT_US:%.*]], label [[BB_SPLIT:%.*]]
17 ; CHECK-NEXT: br label [[BB3_US:%.*]]
19 ; CHECK-NEXT: br label [[GUARDED_US:%.*]]
21 ; CHECK-NEXT: invoke void @widget()
22 ; CHECK-NEXT: to label [[BB6_US:%.*]] unwind label [[BB7_SPLIT_US:%.*]]
24 ; CHECK-NEXT: invoke void @widget()
25 ; CHECK-NEXT: to label [[BB3_US]] unwind label [[BB7_SPLIT_US]]
27 ; CHECK-NEXT: invoke void @widget()
28 ; CHECK-NEXT: to label [[BB4_US:%.*]] unwind label [[BB7_SPLIT_US]]
29 ; CHECK: bb7.split.us:
30 ; CHECK-NEXT: [[TMP8_US:%.*]] = landingpad { ptr, i32 }
32 ; CHECK-NEXT: br label [[BB7:%.*]]
34 ; CHECK-NEXT: br label [[BB3:%.*]]
36 ; CHECK-NEXT: br label [[DEOPT:%.*]]
38 ; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 false, i32 7) [ "deopt"() ]
39 ; CHECK-NEXT: unreachable
41 ; CHECK-NEXT: ret void
44 %tmp = icmp slt i32 poison, 570
45 %tmp2 = select i1 %tmp, i1 true, i1 false
48 bb3: ; preds = %bb6, %bb
49 call void (i1, ...) @llvm.experimental.guard(i1 %tmp2, i32 7) [ "deopt"() ]
51 to label %bb4 unwind label %bb7
55 to label %bb6 unwind label %bb7
59 to label %bb3 unwind label %bb7
61 bb7: ; preds = %bb6, %bb4, %bb3
62 %tmp8 = landingpad { ptr, i32 }