1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=constraint-elimination -S %s | FileCheck --check-prefixes=COMMON,SIMP %s
3 ; RUN: opt -passes=constraint-elimination -constraint-elimination-max-rows=9 -S %s | FileCheck --check-prefixes=COMMON,SIMP %s
4 ; RUN: opt -passes=constraint-elimination -constraint-elimination-max-rows=8 -S %s | FileCheck --check-prefixes=COMMON,NOSIMP %s
7 define i1 @test_max_row_limit(i32 %l0, i32 %l1, i32 %l2, i32 %l3, i32 %l4) {
8 ; SIMP-LABEL: @test_max_row_limit(
10 ; SIMP-NEXT: [[C0:%.*]] = icmp uge i32 [[L0:%.*]], 100
11 ; SIMP-NEXT: br i1 [[C0]], label [[BB1:%.*]], label [[EXIT:%.*]]
13 ; SIMP-NEXT: [[C1:%.*]] = icmp uge i32 [[L1:%.*]], 100
14 ; SIMP-NEXT: br i1 [[C1]], label [[BB2:%.*]], label [[EXIT]]
16 ; SIMP-NEXT: [[C2:%.*]] = icmp uge i32 [[L2:%.*]], 100
17 ; SIMP-NEXT: br i1 [[C2]], label [[BB3:%.*]], label [[EXIT]]
19 ; SIMP-NEXT: [[C3:%.*]] = icmp uge i32 [[L3:%.*]], 100
20 ; SIMP-NEXT: br i1 [[C3]], label [[BB4:%.*]], label [[EXIT]]
22 ; SIMP-NEXT: [[C4:%.*]] = icmp uge i32 [[L4:%.*]], 100
23 ; SIMP-NEXT: br i1 [[C4]], label [[BB5:%.*]], label [[EXIT]]
25 ; SIMP-NEXT: ret i1 true
27 ; SIMP-NEXT: ret i1 false
29 ; NOSIMP-LABEL: @test_max_row_limit(
31 ; NOSIMP-NEXT: [[C0:%.*]] = icmp uge i32 [[L0:%.*]], 100
32 ; NOSIMP-NEXT: br i1 [[C0]], label [[BB1:%.*]], label [[EXIT:%.*]]
34 ; NOSIMP-NEXT: [[C1:%.*]] = icmp uge i32 [[L1:%.*]], 100
35 ; NOSIMP-NEXT: br i1 [[C1]], label [[BB2:%.*]], label [[EXIT]]
37 ; NOSIMP-NEXT: [[C2:%.*]] = icmp uge i32 [[L2:%.*]], 100
38 ; NOSIMP-NEXT: br i1 [[C2]], label [[BB3:%.*]], label [[EXIT]]
40 ; NOSIMP-NEXT: [[C3:%.*]] = icmp uge i32 [[L3:%.*]], 100
41 ; NOSIMP-NEXT: br i1 [[C3]], label [[BB4:%.*]], label [[EXIT]]
43 ; NOSIMP-NEXT: [[C4:%.*]] = icmp uge i32 [[L4:%.*]], 100
44 ; NOSIMP-NEXT: br i1 [[C4]], label [[BB5:%.*]], label [[EXIT]]
46 ; NOSIMP-NEXT: [[C5:%.*]] = icmp uge i32 [[L4]], 100
47 ; NOSIMP-NEXT: ret i1 [[C5]]
49 ; NOSIMP-NEXT: ret i1 false
52 %c0 = icmp uge i32 %l0, 100
53 br i1 %c0, label %bb1, label %exit
56 %c1 = icmp uge i32 %l1, 100
57 br i1 %c1, label %bb2, label %exit
60 %c2 = icmp uge i32 %l2, 100
61 br i1 %c2, label %bb3, label %exit
64 %c3 = icmp uge i32 %l3, 100
65 br i1 %c3, label %bb4, label %exit
68 %c4 = icmp uge i32 %l4, 100
69 br i1 %c4, label %bb5, label %exit
72 %c5 = icmp uge i32 %l4, 100
78 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: