Michael Kruse | cba47b4 | 2018-08-03 04:42:52 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm -o - %s | FileCheck %s |
| 2 | |
Michael Kruse | 0535137 | 2018-12-20 21:24:54 +0000 | [diff] [blame] | 3 | // Verify that the outer loop has the inner loop's access in its |
| 4 | // llvm.loop.parallel_accesses property. |
Michael Kruse | cba47b4 | 2018-08-03 04:42:52 +0000 | [diff] [blame] | 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; |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | // CHECK: %[[MUL:.+]] = mul |
Michael Kruse | 0535137 | 2018-12-20 21:24:54 +0000 | [diff] [blame] | 15 | // CHECK: store i32 %[[MUL]], i32* %{{.+}}, !llvm.access.group ![[ACCESS_GROUP_2:[0-9]+]] |
Michael Kruse | cba47b4 | 2018-08-03 04:42:52 +0000 | [diff] [blame] | 16 | // CHECK: br label %{{.+}}, !llvm.loop ![[INNER_LOOPID:[0-9]+]] |
Michael Kruse | 0535137 | 2018-12-20 21:24:54 +0000 | [diff] [blame] | 17 | // CHECK: br label %{{.+}}, !llvm.loop ![[OUTER_LOOPID:[0-9]+]] |
Michael Kruse | cba47b4 | 2018-08-03 04:42:52 +0000 | [diff] [blame] | 18 | |
Michael Kruse | 0535137 | 2018-12-20 21:24:54 +0000 | [diff] [blame] | 19 | // CHECK: ![[ACCESS_GROUP_2]] = distinct !{} |
Michael Kruse | cba47b4 | 2018-08-03 04:42:52 +0000 | [diff] [blame] | 20 | // CHECK: ![[INNER_LOOPID]] = distinct !{![[INNER_LOOPID]], |
Michael Kruse | 58e7642 | 2019-04-01 17:47:41 +0000 | [diff] [blame] | 21 | // CHECK: ![[OUTER_LOOPID]] = distinct !{![[OUTER_LOOPID]], ![[PARALLEL_ACCESSES_9:[0-9]+]] |
Michael Kruse | 0535137 | 2018-12-20 21:24:54 +0000 | [diff] [blame] | 22 | // CHECK: ![[PARALLEL_ACCESSES_9]] = !{!"llvm.loop.parallel_accesses", ![[ACCESS_GROUP_2]]} |