File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
llvm/test/Analysis/ScalarEvolution Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -123,3 +123,28 @@ loop:
123
123
leave:
124
124
ret void
125
125
}
126
+
127
+ define void @non_zero_from_loop_guard (i16 %n ) {
128
+ ; CHECK-LABEL: 'non_zero_from_loop_guard'
129
+ ; CHECK-NEXT: Determining loop execution counts for: @non_zero_from_loop_guard
130
+ ; CHECK-NEXT: Loop %loop: backedge-taken count is (-1 + (1 umax (%n /u 2)))<nsw>
131
+ ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 32766
132
+ ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + (1 umax (%n /u 2)))<nsw>
133
+ ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + (1 umax (%n /u 2)))<nsw>
134
+ ; CHECK-NEXT: Predicates:
135
+ ; CHECK-NEXT: Loop %loop: Trip multiple is 1
136
+ ;
137
+ entry:
138
+ %shr = lshr i16 %n , 1
139
+ %precond = icmp ult i16 %n , 2
140
+ br i1 %precond , label %exit , label %loop
141
+
142
+ loop:
143
+ %iv = phi i16 [ %inc , %loop ], [ 0 , %entry ]
144
+ %inc = add nuw nsw i16 %iv , 1
145
+ %cmp = icmp ult i16 %inc , %shr
146
+ br i1 %cmp , label %loop , label %exit
147
+
148
+ exit:
149
+ ret void
150
+ }
You can’t perform that action at this time.
0 commit comments