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 -verify-memoryssa < %s | FileCheck %s
6 declare void @llvm.experimental.guard(i1, ...)
9 define void @foo(ptr addrspace(1) %arg, i64 %arg1) personality ptr @pluto {
12 ; CHECK-NEXT: [[TMP:%.*]] = icmp slt i32 poison, 570
13 ; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[TMP]], i1 true, i1 false
14 ; CHECK-NEXT: br i1 [[TMP]], label [[BB_SPLIT_US:%.*]], label [[BB_SPLIT:%.*]]
16 ; CHECK-NEXT: br label [[BB3_US:%.*]]
18 ; CHECK-NEXT: br label [[GUARDED_US:%.*]]
20 ; CHECK-NEXT: invoke void @widget()
21 ; CHECK-NEXT: to label [[BB6_US:%.*]] unwind label [[BB7_SPLIT_US:%.*]]
23 ; CHECK-NEXT: invoke void @widget()
24 ; CHECK-NEXT: to label [[BB3_US]] unwind label [[BB7_SPLIT_US]]
26 ; CHECK-NEXT: invoke void @widget()
27 ; CHECK-NEXT: to label [[BB4_US:%.*]] unwind label [[BB7_SPLIT_US]]
28 ; CHECK: bb7.split.us:
29 ; CHECK-NEXT: [[TMP8_US:%.*]] = landingpad { ptr, i32 }
31 ; CHECK-NEXT: br label [[BB7:%.*]]
33 ; CHECK-NEXT: br label [[BB3:%.*]]
35 ; CHECK-NEXT: br label [[DEOPT:%.*]]
37 ; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 false, i32 7) [ "deopt"() ]
38 ; CHECK-NEXT: unreachable
40 ; CHECK-NEXT: ret void
43 %tmp = icmp slt i32 poison, 570
44 %tmp2 = select i1 %tmp, i1 true, i1 false
47 bb3: ; preds = %bb6, %bb
48 call void (i1, ...) @llvm.experimental.guard(i1 %tmp2, i32 7) [ "deopt"() ]
50 to label %bb4 unwind label %bb7
54 to label %bb6 unwind label %bb7
58 to label %bb3 unwind label %bb7
60 bb7: ; preds = %bb6, %bb4, %bb3
61 %tmp8 = landingpad { ptr, i32 }