xref: /llvm-project/llvm/test/Transforms/LoopVectorize/interleaved-accesses-max-dependences.ll (revision 3cf24dbbdde01386edc69919bbdaad6be2a822be)
1; RUN: opt -passes=loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -enable-interleaved-mem-accesses=true -max-dependences=0 -S %s | FileCheck %s
2target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
3
4; None of these stores have dependences between them, so we can successfully
5; interleave them even though the max-dependences threshold is 0.
6define void @three_interleaved_stores(ptr %arr) {
7; CHECK-LABEL: define void @three_interleaved_stores
8; CHECK:   store <12 x i8>
9entry:
10  br label %loop
11
12loop:
13  %i = phi i64 [ 0, %entry ], [ %i.next, %loop ]
14  %i.plus.1 = add nuw nsw i64 %i, 1
15  %i.plus.2 = add nuw nsw i64 %i, 2
16  %gep.i.plus.0 = getelementptr inbounds i8, ptr %arr, i64 %i
17  %gep.i.plus.1 = getelementptr inbounds i8, ptr %arr, i64 %i.plus.1
18  %gep.i.plus.2 = getelementptr inbounds i8, ptr %arr, i64 %i.plus.2
19  store i8 1, ptr %gep.i.plus.0
20  store i8 1, ptr %gep.i.plus.1
21  store i8 1, ptr %gep.i.plus.2
22  %i.next = add nuw nsw i64 %i, 3
23  %icmp = icmp ugt i64 %i, 1032
24  br i1 %icmp, label %exit, label %loop
25
26exit:
27  ret void
28}
29