• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -enable-interleaved-mem-accesses=true < %s
2
3; Make sure the vectorizer can handle this loop: The strided load is only used
4; by the loop's exit condition, which is not vectorized, and is therefore
5; considered uniform while also forming an interleave group.
6
7%0 = type { i32 ()*, i32 }
8
9@0 = internal unnamed_addr constant [59 x %0] [%0 zeroinitializer,
10%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
11%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
12%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
13%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
14%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
15%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
16%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
17%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
18%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
19%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
20%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
21%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
22%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
23%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
24%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
25%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
26%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
27%0 {i32 ()* null, i32 258}, %0 zeroinitializer, %0 zeroinitializer,
28%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
29%0 zeroinitializer], align 8
30
31define dso_local void @test_dead_load(i32 %arg) {
32; CHECK-LABEL: @test_dead_load(
33; CHECK: vector.body:
34; CHECK: %wide.vec = load <16 x i32>, <16 x i32>* %3, align 8
35; CHECK: %strided.vec = shufflevector <16 x i32> %wide.vec, <16 x i32> undef, <4 x i32> <i32 0, i32 4, i32 8, i32 12>
36bb1:
37  br label %bb2
38
39bb2:
40  %tmp = phi %0* [ %tmp6, %bb2 ], [ getelementptr inbounds ([59 x %0], [59 x %0]* @0, i64 0, i64 0), %bb1 ]
41  %tmp3 = getelementptr inbounds %0, %0* %tmp, i64 0, i32 1
42  %tmp4 = load i32, i32* %tmp3, align 8
43  %tmp5 = icmp eq i32 %tmp4, 258
44  %tmp6 = getelementptr inbounds %0, %0* %tmp, i64 1
45  br i1 %tmp5, label %bb65, label %bb2
46
47bb65:
48  unreachable
49}
50