xref: /llvm-project/llvm/test/Analysis/ScalarEvolution/exit-count-select.ll (revision 16bc24e7be90f32056a1915d8c57adf1478384e0)
1509fa8e0SJuneyoung Lee; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2509fa8e0SJuneyoung Lee; RUN: opt -disable-output "-passes=print<scalar-evolution>" %s 2>&1 | FileCheck %s
3509fa8e0SJuneyoung Lee
4509fa8e0SJuneyoung Lee; If m is constant, exact-not-taken is umin(n, m)
5509fa8e0SJuneyoung Lee; https://alive2.llvm.org/ce/z/ZTNXgY
6509fa8e0SJuneyoung Leedefine void @logical_and_m_const(i32 %n) {
7509fa8e0SJuneyoung Lee; CHECK-LABEL: 'logical_and_m_const'
8509fa8e0SJuneyoung Lee; CHECK-NEXT:  Classifying expressions for: @logical_and_m_const
9509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
10509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {0,+,1}<%loop> U: [0,3) S: [0,3) Exits: (2 umin %n) LoopDispositions: { %loop: Computable }
11509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i.next = add i32 %i, 1
12509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {1,+,1}<%loop> U: [1,4) S: [1,4) Exits: (1 + (2 umin %n))<nuw><nsw> LoopDispositions: { %loop: Computable }
13509fa8e0SJuneyoung Lee; CHECK-NEXT:    %cond = select i1 %cond_i, i1 %cond_i2, i1 false
14*16bc24e7SRoman Lebedev; CHECK-NEXT:    --> (%cond_i umin_seq %cond_i2) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
15509fa8e0SJuneyoung Lee; CHECK-NEXT:  Determining loop execution counts for: @logical_and_m_const
16509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: backedge-taken count is (2 umin %n)
17509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: max backedge-taken count is 2
18509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Predicated backedge-taken count is (2 umin %n)
19509fa8e0SJuneyoung Lee; CHECK-NEXT:   Predicates:
20509fa8e0SJuneyoung Lee; CHECK:       Loop %loop: Trip multiple is 1
21509fa8e0SJuneyoung Lee;
22509fa8e0SJuneyoung Leeentry:
23509fa8e0SJuneyoung Lee  br label %loop
24509fa8e0SJuneyoung Leeloop:
25509fa8e0SJuneyoung Lee  %i = phi i32 [0, %entry], [%i.next, %loop]
26509fa8e0SJuneyoung Lee  %i.next = add i32 %i, 1
27509fa8e0SJuneyoung Lee  %cond_i = icmp ult i32 %i, %n
28509fa8e0SJuneyoung Lee  %cond_i2 = icmp ult i32 %i, 2
29509fa8e0SJuneyoung Lee  %cond = select i1 %cond_i, i1 %cond_i2, i1 false
30509fa8e0SJuneyoung Lee  br i1 %cond, label %loop, label %exit
31509fa8e0SJuneyoung Leeexit:
32509fa8e0SJuneyoung Lee  ret void
33509fa8e0SJuneyoung Lee}
34509fa8e0SJuneyoung Lee
35509fa8e0SJuneyoung Lee; exact-not-taken is umin(2, m) because m participates in the exit branch condition.
36509fa8e0SJuneyoung Lee; https://alive2.llvm.org/ce/z/rCVMmp
37509fa8e0SJuneyoung Leedefine void @logical_and_nonzero(i32 %m) {
38509fa8e0SJuneyoung Lee; CHECK-LABEL: 'logical_and_nonzero'
39509fa8e0SJuneyoung Lee; CHECK-NEXT:  Classifying expressions for: @logical_and_nonzero
40509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
41509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {0,+,1}<%loop> U: [0,3) S: [0,3) Exits: (2 umin %m) LoopDispositions: { %loop: Computable }
42509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i.next = add i32 %i, 1
43509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {1,+,1}<%loop> U: [1,4) S: [1,4) Exits: (1 + (2 umin %m))<nuw><nsw> LoopDispositions: { %loop: Computable }
44509fa8e0SJuneyoung Lee; CHECK-NEXT:    %cond = select i1 %cond_i, i1 %cond_i2, i1 false
45*16bc24e7SRoman Lebedev; CHECK-NEXT:    --> (%cond_i umin_seq %cond_i2) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
46509fa8e0SJuneyoung Lee; CHECK-NEXT:  Determining loop execution counts for: @logical_and_nonzero
47509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: backedge-taken count is (2 umin %m)
48509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: max backedge-taken count is 2
49509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Predicated backedge-taken count is (2 umin %m)
50509fa8e0SJuneyoung Lee; CHECK-NEXT:   Predicates:
51509fa8e0SJuneyoung Lee; CHECK:       Loop %loop: Trip multiple is 1
52509fa8e0SJuneyoung Lee;
53509fa8e0SJuneyoung Leeentry:
54509fa8e0SJuneyoung Lee  br label %loop
55509fa8e0SJuneyoung Leeloop:
56509fa8e0SJuneyoung Lee  %i = phi i32 [0, %entry], [%i.next, %loop]
57509fa8e0SJuneyoung Lee  %i.next = add i32 %i, 1
58509fa8e0SJuneyoung Lee  %cond_i = icmp ult i32 %i, 2
59509fa8e0SJuneyoung Lee  %cond_i2 = icmp ult i32 %i, %m
60509fa8e0SJuneyoung Lee  %cond = select i1 %cond_i, i1 %cond_i2, i1 false
61509fa8e0SJuneyoung Lee  br i1 %cond, label %loop, label %exit
62509fa8e0SJuneyoung Leeexit:
63509fa8e0SJuneyoung Lee  ret void
64509fa8e0SJuneyoung Lee}
65509fa8e0SJuneyoung Lee
66509fa8e0SJuneyoung Lee; exact-not-taken cannot be umin(0, m) because m never participates in the exit branch condition.
67509fa8e0SJuneyoung Lee; https://alive2.llvm.org/ce/z/rlaN4a
68509fa8e0SJuneyoung Lee; Instead, it should be just 0.
69509fa8e0SJuneyoung Leedefine void @logical_and_zero(i32 %m) {
70509fa8e0SJuneyoung Lee; CHECK-LABEL: 'logical_and_zero'
71509fa8e0SJuneyoung Lee; CHECK-NEXT:  Classifying expressions for: @logical_and_zero
72509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
73509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {0,+,1}<%loop> U: [0,1) S: [0,1) Exits: 0 LoopDispositions: { %loop: Computable }
74509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i.next = add i32 %i, 1
75509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {1,+,1}<%loop> U: [1,2) S: [1,2) Exits: 1 LoopDispositions: { %loop: Computable }
76509fa8e0SJuneyoung Lee; CHECK-NEXT:    %cond = select i1 %cond_i, i1 %cond_i2, i1 false
77*16bc24e7SRoman Lebedev; CHECK-NEXT:    --> (%cond_i umin_seq %cond_i2) U: full-set S: full-set Exits: false LoopDispositions: { %loop: Variant }
78509fa8e0SJuneyoung Lee; CHECK-NEXT:  Determining loop execution counts for: @logical_and_zero
79509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: backedge-taken count is 0
80509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: max backedge-taken count is 0
81509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Predicated backedge-taken count is 0
82509fa8e0SJuneyoung Lee; CHECK-NEXT:   Predicates:
83509fa8e0SJuneyoung Lee; CHECK:       Loop %loop: Trip multiple is 1
84509fa8e0SJuneyoung Lee;
85509fa8e0SJuneyoung Leeentry:
86509fa8e0SJuneyoung Lee  br label %loop
87509fa8e0SJuneyoung Leeloop:
88509fa8e0SJuneyoung Lee  %i = phi i32 [0, %entry], [%i.next, %loop]
89509fa8e0SJuneyoung Lee  %i.next = add i32 %i, 1
90509fa8e0SJuneyoung Lee  %cond_i = icmp ult i32 %i, 0
91509fa8e0SJuneyoung Lee  %cond_i2 = icmp ult i32 %i, %m
92509fa8e0SJuneyoung Lee  %cond = select i1 %cond_i, i1 %cond_i2, i1 false
93509fa8e0SJuneyoung Lee  br i1 %cond, label %loop, label %exit
94509fa8e0SJuneyoung Leeexit:
95509fa8e0SJuneyoung Lee  ret void
96509fa8e0SJuneyoung Lee}
97509fa8e0SJuneyoung Lee
98509fa8e0SJuneyoung Lee; exact-not-taken is umax(n, m) because both conditions (cond_i, cond_i2) participate in branching,
99509fa8e0SJuneyoung Lee; preventing them from being poison.
100509fa8e0SJuneyoung Lee; https://alive2.llvm.org/ce/z/8_p-zu
101509fa8e0SJuneyoung Lee; Currently SCEV is conservative in this case and simply returns unknown.
102509fa8e0SJuneyoung Leedefine void @logical_and_inversed(i32 %n, i32 %m) {
103509fa8e0SJuneyoung Lee; CHECK-LABEL: 'logical_and_inversed'
104509fa8e0SJuneyoung Lee; CHECK-NEXT:  Classifying expressions for: @logical_and_inversed
105509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
106509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {0,+,1}<%loop> U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
107509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i.next = add i32 %i, 1
108509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {1,+,1}<%loop> U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
109509fa8e0SJuneyoung Lee; CHECK-NEXT:    %cond = select i1 %cond_i, i1 %cond_i2, i1 false
110*16bc24e7SRoman Lebedev; CHECK-NEXT:    --> (%cond_i umin_seq %cond_i2) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
111509fa8e0SJuneyoung Lee; CHECK-NEXT:  Determining loop execution counts for: @logical_and_inversed
112509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Unpredictable backedge-taken count.
113509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Unpredictable max backedge-taken count.
114509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Unpredictable predicated backedge-taken count.
115509fa8e0SJuneyoung Lee;
116509fa8e0SJuneyoung Leeentry:
117509fa8e0SJuneyoung Lee  br label %loop
118509fa8e0SJuneyoung Leeloop:
119509fa8e0SJuneyoung Lee  %i = phi i32 [0, %entry], [%i.next, %loop]
120509fa8e0SJuneyoung Lee  %i.next = add i32 %i, 1
121509fa8e0SJuneyoung Lee  %cond_i = icmp uge i32 %i, %n
122509fa8e0SJuneyoung Lee  %cond_i2 = icmp uge i32 %i, %m
123509fa8e0SJuneyoung Lee  %cond = select i1 %cond_i, i1 %cond_i2, i1 false
124509fa8e0SJuneyoung Lee  br i1 %cond, label %exit, label %loop
125509fa8e0SJuneyoung Leeexit:
126509fa8e0SJuneyoung Lee  ret void
127509fa8e0SJuneyoung Lee}
128509fa8e0SJuneyoung Lee
129509fa8e0SJuneyoung Lee; If m is constant,  exact-not-taken is umin(n, m)
130509fa8e0SJuneyoung Lee; https://alive2.llvm.org/ce/z/RQmJiq
131509fa8e0SJuneyoung Leedefine void @logical_or_m_const(i32 %n) {
132509fa8e0SJuneyoung Lee; CHECK-LABEL: 'logical_or_m_const'
133509fa8e0SJuneyoung Lee; CHECK-NEXT:  Classifying expressions for: @logical_or_m_const
134509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
135509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {0,+,1}<%loop> U: [0,3) S: [0,3) Exits: (2 umin %n) LoopDispositions: { %loop: Computable }
136509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i.next = add i32 %i, 1
137509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {1,+,1}<%loop> U: [1,4) S: [1,4) Exits: (1 + (2 umin %n))<nuw><nsw> LoopDispositions: { %loop: Computable }
138509fa8e0SJuneyoung Lee; CHECK-NEXT:    %cond = select i1 %cond_i, i1 true, i1 %cond_i2
139509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> %cond U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
140509fa8e0SJuneyoung Lee; CHECK-NEXT:  Determining loop execution counts for: @logical_or_m_const
141509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: backedge-taken count is (2 umin %n)
142509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: max backedge-taken count is 2
143509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Predicated backedge-taken count is (2 umin %n)
144509fa8e0SJuneyoung Lee; CHECK-NEXT:   Predicates:
145509fa8e0SJuneyoung Lee; CHECK:       Loop %loop: Trip multiple is 1
146509fa8e0SJuneyoung Lee;
147509fa8e0SJuneyoung Leeentry:
148509fa8e0SJuneyoung Lee  br label %loop
149509fa8e0SJuneyoung Leeloop:
150509fa8e0SJuneyoung Lee  %i = phi i32 [0, %entry], [%i.next, %loop]
151509fa8e0SJuneyoung Lee  %i.next = add i32 %i, 1
152509fa8e0SJuneyoung Lee  %cond_i = icmp uge i32 %i, %n
153509fa8e0SJuneyoung Lee  %cond_i2 = icmp uge i32 %i, 2
154509fa8e0SJuneyoung Lee  %cond = select i1 %cond_i, i1 true, i1 %cond_i2
155509fa8e0SJuneyoung Lee  br i1 %cond, label %exit, label %loop
156509fa8e0SJuneyoung Leeexit:
157509fa8e0SJuneyoung Lee  ret void
158509fa8e0SJuneyoung Lee}
159509fa8e0SJuneyoung Lee
160509fa8e0SJuneyoung Lee; exact-not-taken is umin(2, m) because m participates in exit branch condition.
161509fa8e0SJuneyoung Lee; https://alive2.llvm.org/ce/z/zcHS_d
162509fa8e0SJuneyoung Leedefine void @logical_or_nonzero(i32 %m) {
163509fa8e0SJuneyoung Lee; CHECK-LABEL: 'logical_or_nonzero'
164509fa8e0SJuneyoung Lee; CHECK-NEXT:  Classifying expressions for: @logical_or_nonzero
165509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
166509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {0,+,1}<%loop> U: [0,3) S: [0,3) Exits: (2 umin %m) LoopDispositions: { %loop: Computable }
167509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i.next = add i32 %i, 1
168509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {1,+,1}<%loop> U: [1,4) S: [1,4) Exits: (1 + (2 umin %m))<nuw><nsw> LoopDispositions: { %loop: Computable }
169509fa8e0SJuneyoung Lee; CHECK-NEXT:    %cond = select i1 %cond_i, i1 true, i1 %cond_i2
170509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> %cond U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
171509fa8e0SJuneyoung Lee; CHECK-NEXT:  Determining loop execution counts for: @logical_or_nonzero
172509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: backedge-taken count is (2 umin %m)
173509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: max backedge-taken count is 2
174509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Predicated backedge-taken count is (2 umin %m)
175509fa8e0SJuneyoung Lee; CHECK-NEXT:   Predicates:
176509fa8e0SJuneyoung Lee; CHECK:       Loop %loop: Trip multiple is 1
177509fa8e0SJuneyoung Lee;
178509fa8e0SJuneyoung Leeentry:
179509fa8e0SJuneyoung Lee  br label %loop
180509fa8e0SJuneyoung Leeloop:
181509fa8e0SJuneyoung Lee  %i = phi i32 [0, %entry], [%i.next, %loop]
182509fa8e0SJuneyoung Lee  %i.next = add i32 %i, 1
183509fa8e0SJuneyoung Lee  %cond_i = icmp uge i32 %i, 2
184509fa8e0SJuneyoung Lee  %cond_i2 = icmp uge i32 %i, %m
185509fa8e0SJuneyoung Lee  %cond = select i1 %cond_i, i1 true, i1 %cond_i2
186509fa8e0SJuneyoung Lee  br i1 %cond, label %exit, label %loop
187509fa8e0SJuneyoung Leeexit:
188509fa8e0SJuneyoung Lee  ret void
189509fa8e0SJuneyoung Lee}
190509fa8e0SJuneyoung Lee
191509fa8e0SJuneyoung Lee; exact-not-taken cannot be umin(0, m) because m does not participate in exit branch condition.
192509fa8e0SJuneyoung Lee; https://alive2.llvm.org/ce/z/-dUmmc
193509fa8e0SJuneyoung Lee; Instead, exact-not-taken should be just 0.
194509fa8e0SJuneyoung Leedefine void @logical_or_zero(i32 %m) {
195509fa8e0SJuneyoung Lee; CHECK-LABEL: 'logical_or_zero'
196509fa8e0SJuneyoung Lee; CHECK-NEXT:  Classifying expressions for: @logical_or_zero
197509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
198509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {0,+,1}<%loop> U: [0,1) S: [0,1) Exits: 0 LoopDispositions: { %loop: Computable }
199509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i.next = add i32 %i, 1
200509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {1,+,1}<%loop> U: [1,2) S: [1,2) Exits: 1 LoopDispositions: { %loop: Computable }
201509fa8e0SJuneyoung Lee; CHECK-NEXT:    %cond = select i1 %cond_i, i1 true, i1 %cond_i2
202509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> %cond U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
203509fa8e0SJuneyoung Lee; CHECK-NEXT:  Determining loop execution counts for: @logical_or_zero
204509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: backedge-taken count is 0
205509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: max backedge-taken count is 0
206509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Predicated backedge-taken count is 0
207509fa8e0SJuneyoung Lee; CHECK-NEXT:   Predicates:
208509fa8e0SJuneyoung Lee; CHECK:       Loop %loop: Trip multiple is 1
209509fa8e0SJuneyoung Lee;
210509fa8e0SJuneyoung Leeentry:
211509fa8e0SJuneyoung Lee  br label %loop
212509fa8e0SJuneyoung Leeloop:
213509fa8e0SJuneyoung Lee  %i = phi i32 [0, %entry], [%i.next, %loop]
214509fa8e0SJuneyoung Lee  %i.next = add i32 %i, 1
215509fa8e0SJuneyoung Lee  %cond_i = icmp uge i32 %i, 0
216509fa8e0SJuneyoung Lee  %cond_i2 = icmp uge i32 %i, %m
217509fa8e0SJuneyoung Lee  %cond = select i1 %cond_i, i1 true, i1 %cond_i2
218509fa8e0SJuneyoung Lee  br i1 %cond, label %exit, label %loop
219509fa8e0SJuneyoung Leeexit:
220509fa8e0SJuneyoung Lee  ret void
221509fa8e0SJuneyoung Lee}
222509fa8e0SJuneyoung Lee
223509fa8e0SJuneyoung Lee; exact-not-taken is umax(n, m) because both conditions (cond_i, cond_i2) participate in branching,
224509fa8e0SJuneyoung Lee; preventing them from being poison.
225509fa8e0SJuneyoung Lee; https://alive2.llvm.org/ce/z/VaCu9C
226509fa8e0SJuneyoung Lee; Currently SCEV is conservative in this case and simply returns unknown.
227509fa8e0SJuneyoung Leedefine void @logical_or_inversed(i32 %n, i32 %m) {
228509fa8e0SJuneyoung Lee; CHECK-LABEL: 'logical_or_inversed'
229509fa8e0SJuneyoung Lee; CHECK-NEXT:  Classifying expressions for: @logical_or_inversed
230509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
231509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {0,+,1}<%loop> U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
232509fa8e0SJuneyoung Lee; CHECK-NEXT:    %i.next = add i32 %i, 1
233509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> {1,+,1}<%loop> U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Computable }
234509fa8e0SJuneyoung Lee; CHECK-NEXT:    %cond = select i1 %cond_i, i1 true, i1 %cond_i2
235509fa8e0SJuneyoung Lee; CHECK-NEXT:    --> %cond U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }
236509fa8e0SJuneyoung Lee; CHECK-NEXT:  Determining loop execution counts for: @logical_or_inversed
237509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Unpredictable backedge-taken count.
238509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Unpredictable max backedge-taken count.
239509fa8e0SJuneyoung Lee; CHECK-NEXT:  Loop %loop: Unpredictable predicated backedge-taken count.
240509fa8e0SJuneyoung Lee;
241509fa8e0SJuneyoung Leeentry:
242509fa8e0SJuneyoung Lee  br label %loop
243509fa8e0SJuneyoung Leeloop:
244509fa8e0SJuneyoung Lee  %i = phi i32 [0, %entry], [%i.next, %loop]
245509fa8e0SJuneyoung Lee  %i.next = add i32 %i, 1
246509fa8e0SJuneyoung Lee  %cond_i = icmp ult i32 %i, %n
247509fa8e0SJuneyoung Lee  %cond_i2 = icmp ult i32 %i, %m
248509fa8e0SJuneyoung Lee  %cond = select i1 %cond_i, i1 true, i1 %cond_i2
249509fa8e0SJuneyoung Lee  br i1 %cond, label %loop, label %exit
250509fa8e0SJuneyoung Leeexit:
251509fa8e0SJuneyoung Lee  ret void
252509fa8e0SJuneyoung Lee}
253