-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeGen] Generate llvm.loop.parallel_accesses instead of llvm.mem.pa…
…rallel_loop_access metadata. Instead of generating llvm.mem.parallel_loop_access metadata, generate llvm.access.group on instructions and llvm.loop.parallel_accesses on loops. There is one access group per generated loop. This is clang part of D52116/r349725. Differential Revision: https://reviews.llvm.org/D52117 llvm-svn: 349823
- Loading branch information
1 parent
a6b9c68
commit 0535137
Showing
17 changed files
with
326 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm -o - %s | FileCheck %s | ||
|
|
||
| // Verify that the outer loop has the llvm.access.group property for the | ||
| // accesses outside and inside the inner loop, even when the inner loop | ||
| // is not perfectly nested. | ||
| void vectorize_imperfectly_nested_test(int *List, int Length) { | ||
| #pragma clang loop vectorize(assume_safety) interleave(disable) unroll(disable) | ||
| for (int i = 0; i < Length; ++i) { | ||
| List[i * Length] = 42; | ||
| #pragma clang loop vectorize(assume_safety) interleave(disable) unroll(disable) | ||
| for (int j = 1; j < Length - 1; ++j) | ||
| List[i * Length + j] = (i + j) * 2; | ||
| List[(i + 1) * Length - 1] = 21; | ||
| } | ||
| } | ||
|
|
||
|
|
||
| // CHECK: load i32, i32* %Length.addr, align 4, !llvm.access.group ![[ACCESS_GROUP_2:[0-9]+]] | ||
|
|
||
| // CHECK: %[[MUL:.+]] = mul nsw i32 %add, 2 | ||
| // CHECK: store i32 %[[MUL]], i32* %{{.+}}, !llvm.access.group ![[ACCESS_GROUP_3:[0-9]+]] | ||
| // CHECK: br label %{{.+}}, !llvm.loop ![[INNER_LOOPID:[0-9]+]] | ||
| // CHECK: store i32 21, i32* %{{.+}}, !llvm.access.group ![[ACCESS_GROUP_2]] | ||
| // CHECK: br label %{{.+}}, !llvm.loop ![[OUTER_LOOPID:[0-9]+]] | ||
|
|
||
| // CHECK: ![[ACCESS_GROUP_2]] = distinct !{} | ||
| // CHECK: ![[ACCESS_GROUP_LIST_3:[0-9]+]] = !{![[ACCESS_GROUP_2]], ![[ACCESS_GROUP_4:[0-9]+]]} | ||
| // CHECK: ![[ACCESS_GROUP_4]] = distinct !{} | ||
| // CHECK: ![[INNER_LOOPID]] = distinct !{![[INNER_LOOPID]], {{.*}} ![[PARALLEL_ACCESSES_8:[0-9]+]]} | ||
| // CHECK: ![[PARALLEL_ACCESSES_8]] = !{!"llvm.loop.parallel_accesses", ![[ACCESS_GROUP_4]]} | ||
| // CHECK: ![[OUTER_LOOPID]] = distinct !{![[OUTER_LOOPID]], {{.*}} ![[PARALLEL_ACCESSES_10:[0-9]+]]} | ||
| // CHECK: ![[PARALLEL_ACCESSES_10]] = !{!"llvm.loop.parallel_accesses", ![[ACCESS_GROUP_2]]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.