1 // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm -o - %s | FileCheck %s
3 // Verify that the outer loop has the inner loop's access in its
4 // llvm.loop.parallel_accesses property.
5 void vectorize_outer_test(int *List
, int Length
) {
6 #pragma clang loop vectorize(assume_safety) interleave(disable) unroll(disable)
7 for (int i
= 0; i
< Length
; i
+= 2) {
8 #pragma clang loop unroll(full)
9 for (int j
= 0; j
< 2; j
+= 1)
10 List
[i
+ j
] = (i
+ j
) * 2;
14 // CHECK: %[[MUL:.+]] = mul
15 // CHECK: store i32 %[[MUL]], ptr %{{.+}}, !llvm.access.group ![[ACCESS_GROUP_2:[0-9]+]]
16 // CHECK: br label %{{.+}}, !llvm.loop ![[INNER_LOOPID:[0-9]+]]
17 // CHECK: br label %{{.+}}, !llvm.loop ![[OUTER_LOOPID:[0-9]+]]
19 // CHECK: ![[ACCESS_GROUP_2]] = distinct !{}
20 // CHECK: ![[INNER_LOOPID]] = distinct !{![[INNER_LOOPID]],
21 // CHECK: ![[OUTER_LOOPID]] = distinct !{![[OUTER_LOOPID]], [[MP:![0-9]+]], ![[PARALLEL_ACCESSES_9:[0-9]+]]
22 // CHECK: ![[PARALLEL_ACCESSES_9]] = !{!"llvm.loop.parallel_accesses", ![[ACCESS_GROUP_2]]}