1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
3 ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -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='require<domtree>,loop(simplify-cfg)' -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
5 ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -loop-simplifycfg -enable-mssa-loop-dependency=true -verify-memoryssa -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
7 target triple = "x86_64-unknown-linux-gnu"
11 ; CHECK-NEXT: br label [[BB1:%.*]]
12 ; CHECK: bb1.loopexit:
13 ; CHECK-NEXT: br label [[BB1]]
15 ; CHECK-NEXT: br label [[BB2:%.*]]
16 ; CHECK: bb2.loopexit:
17 ; CHECK-NEXT: br label [[BB2]]
19 ; CHECK-NEXT: switch i32 0, label [[BB2_SPLIT:%.*]] [
20 ; CHECK-NEXT: i32 1, label [[BB1_LOOPEXIT:%.*]]
21 ; CHECK-NEXT: i32 2, label [[BB2_LOOPEXIT:%.*]]
24 ; CHECK-NEXT: br label [[BB3:%.*]]
26 ; CHECK-NEXT: br label [[BB3]]
31 bb1: ; preds = %bb4, %0
34 bb2: ; preds = %bb6, %bb1
37 bb3: ; preds = %bb8, %bb3, %bb2
38 br i1 false, label %bb4, label %bb3
40 bb4: ; preds = %bb8, %bb3
41 br i1 undef, label %bb1, label %bb6
44 br i1 undef, label %bb2, label %bb8
47 br i1 true, label %bb4, label %bb3
50 define void @test_many_subloops(i1 %c) {
51 ; CHECK-LABEL: @test_many_subloops(
52 ; CHECK-NEXT: br label [[BB1:%.*]]
53 ; CHECK: bb1.loopexit:
54 ; CHECK-NEXT: br label [[BB1]]
56 ; CHECK-NEXT: br label [[BB2:%.*]]
57 ; CHECK: bb2.loopexit:
58 ; CHECK-NEXT: br label [[BB2]]
60 ; CHECK-NEXT: switch i32 0, label [[BB2_SPLIT:%.*]] [
61 ; CHECK-NEXT: i32 1, label [[BB1_LOOPEXIT:%.*]]
62 ; CHECK-NEXT: i32 2, label [[BB2_LOOPEXIT:%.*]]
65 ; CHECK-NEXT: br label [[BB3:%.*]]
67 ; CHECK-NEXT: br label [[BB3]]
79 br i1 false, label %bb4, label %bb3
82 br i1 undef, label %bb1, label %subloop1
85 br i1 %c, label %subloop2, label %subloop11
88 br i1 %c, label %subloop11, label %subloop12
91 br i1 %c, label %subloop12, label %subloop13
94 br i1 %c, label %subloop13, label %subloop1_latch
100 br i1 %c, label %bb6, label %subloop21
103 br i1 %c, label %subloop21, label %subloop22
106 br i1 %c, label %subloop22, label %subloop23
109 br i1 %c, label %subloop23, label %subloop2_latch
115 br i1 undef, label %bb2, label %bb8
118 br i1 true, label %bb4, label %bb3