1 ; RUN: opt -S -passes=loop-vectorize -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
3 ; This test is checking that a scalable load inside a loop does not trigger a
4 ; TypeSize error in the loop vectorization legality analysis. It is possible for
5 ; a scalable/vector load to appear inside a loop at vectorization legality
6 ; analysis if, for example, the ACLE are used. If we encounter a scalable/vector
7 ; load, it should not be considered for analysis, and we should not see a
10 ; #include <arm_sve.h>
12 ; void scalable_load_in_loop(long n, int *a, int *b, svuint32_t *x,
14 ; for (unsigned i = 0; i < n; i++) {
15 ; if (i % 2 == 0) continue;
21 ; CHECK-LABEL: @scalable_load_in_loop
22 ; CHECK-NOT: vector.body
23 define void @scalable_load_in_loop(i64 %n, ptr %x, ptr %y) {
28 %i = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
30 %cmp = icmp eq i32 %rem, 0
31 br i1 %cmp, label %for.inc, label %if.end
34 %0 = load <vscale x 4 x i32>, ptr %y
35 store <vscale x 4 x i32> %0, ptr %x
40 %cmp2 = icmp slt i64 0, %n
41 br i1 %cmp2, label %for.body, label %for.cleanup