Skip to content

Commit 07e3adf

Browse files
committed
Re-add tripcount test
1 parent 823219a commit 07e3adf

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

llvm/test/Transforms/LoopVectorize/ARM/mve-known-trip-count.ll

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,43 @@ for.body: ; preds = %entry, %for.body
195195
br i1 %cmp, label %for.body, label %for.cond.cleanup
196196
}
197197

198+
; Trip count of 8 - does get vectorized
199+
; CHECK-LABEL: tripcount8
200+
; CHECK: LV: Selecting VF: 4
201+
define void @tripcount8(ptr nocapture readonly %in, ptr nocapture %out, ptr nocapture readonly %consts, i32 %n) #0 {
202+
entry:
203+
%out.promoted = load i32, ptr %out, align 4
204+
br label %for.body
205+
206+
for.cond.cleanup: ; preds = %for.body
207+
store i32 %add12, ptr %out, align 4
208+
ret void
209+
210+
for.body: ; preds = %entry, %for.body
211+
%hop.0236 = phi i32 [ 0, %entry ], [ %add139, %for.body ]
212+
%add12220235 = phi i32 [ %out.promoted, %entry ], [ %add12, %for.body ]
213+
%arrayidx = getelementptr inbounds i16, ptr %in, i32 %hop.0236
214+
%0 = load i16, ptr %arrayidx, align 2
215+
%conv = sext i16 %0 to i32
216+
%arrayidx1 = getelementptr inbounds i16, ptr %consts, i32 %hop.0236
217+
%1 = load i16, ptr %arrayidx1, align 2
218+
%conv2 = sext i16 %1 to i32
219+
%mul = mul nsw i32 %conv2, %conv
220+
%add = add nsw i32 %mul, %add12220235
221+
%add4 = or i32 %hop.0236, 1
222+
%arrayidx5 = getelementptr inbounds i16, ptr %in, i32 %add4
223+
%2 = load i16, ptr %arrayidx5, align 2
224+
%conv6 = sext i16 %2 to i32
225+
%arrayidx8 = getelementptr inbounds i16, ptr %consts, i32 %add4
226+
%3 = load i16, ptr %arrayidx8, align 2
227+
%conv9 = sext i16 %3 to i32
228+
%mul10 = mul nsw i32 %conv9, %conv6
229+
%add12 = add nsw i32 %mul10, %add
230+
%add139 = add nuw nsw i32 %hop.0236, 16
231+
%cmp = icmp ult i32 %hop.0236, 112
232+
br i1 %cmp, label %for.body, label %for.cond.cleanup
233+
}
234+
198235
; Larger example with predication that should also not be vectorized
199236
; CHECK-LABEL: predicated_test
200237
; CHECK: LV: Selecting VF: 1

0 commit comments

Comments
 (0)