1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
3 ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes='require<domtree>,loop(loop-simplifycfg)' -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
4 ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes=loop-simplifycfg -verify-memoryssa -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
6 target triple = "x86_64-unknown-linux-gnu"
10 ; CHECK-NEXT: br label [[BB1:%.*]]
11 ; CHECK: bb1.loopexit:
12 ; CHECK-NEXT: br label [[BB1]]
14 ; CHECK-NEXT: br label [[BB2:%.*]]
15 ; CHECK: bb2.loopexit:
16 ; CHECK-NEXT: br label [[BB2]]
18 ; CHECK-NEXT: switch i32 0, label [[BB2_SPLIT:%.*]] [
19 ; CHECK-NEXT: i32 1, label [[BB1_LOOPEXIT:%.*]]
20 ; CHECK-NEXT: i32 2, label [[BB2_LOOPEXIT:%.*]]
23 ; CHECK-NEXT: br label [[BB3:%.*]]
25 ; CHECK-NEXT: br label [[BB3]]
30 bb1: ; preds = %bb4, %0
33 bb2: ; preds = %bb6, %bb1
36 bb3: ; preds = %bb8, %bb3, %bb2
37 br i1 false, label %bb4, label %bb3
39 bb4: ; preds = %bb8, %bb3
40 br i1 undef, label %bb1, label %bb6
43 br i1 undef, label %bb2, label %bb8
46 br i1 true, label %bb4, label %bb3
49 define void @test_many_subloops(i1 %c) {
50 ; CHECK-LABEL: @test_many_subloops(
51 ; CHECK-NEXT: br label [[BB1:%.*]]
52 ; CHECK: bb1.loopexit:
53 ; CHECK-NEXT: br label [[BB1]]
55 ; CHECK-NEXT: br label [[BB2:%.*]]
56 ; CHECK: bb2.loopexit:
57 ; CHECK-NEXT: br label [[BB2]]
59 ; CHECK-NEXT: switch i32 0, label [[BB2_SPLIT:%.*]] [
60 ; CHECK-NEXT: i32 1, label [[BB1_LOOPEXIT:%.*]]
61 ; CHECK-NEXT: i32 2, label [[BB2_LOOPEXIT:%.*]]
64 ; CHECK-NEXT: br label [[BB3:%.*]]
66 ; CHECK-NEXT: br label [[BB3]]
78 br i1 false, label %bb4, label %bb3
81 br i1 undef, label %bb1, label %subloop1
84 br i1 %c, label %subloop2, label %subloop11
87 br i1 %c, label %subloop11, label %subloop12
90 br i1 %c, label %subloop12, label %subloop13
93 br i1 %c, label %subloop13, label %subloop1_latch
99 br i1 %c, label %bb6, label %subloop21
102 br i1 %c, label %subloop21, label %subloop22
105 br i1 %c, label %subloop22, label %subloop23
108 br i1 %c, label %subloop23, label %subloop2_latch
114 br i1 undef, label %bb2, label %bb8
117 br i1 true, label %bb4, label %bb3