diff options
author | Neil Henning <neil.henning@amd.com> | 2018-10-08 15:49:19 +0000 |
---|---|---|
committer | Neil Henning <neil.henning@amd.com> | 2018-10-08 15:49:19 +0000 |
commit | 6641657453170b57d05de8aea095b0f41f7ba4fe (patch) | |
tree | 09c2793d56ab944aa37f2821995f7c6b06719ec0 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | 307c7901d08430c5db58f7a53ab02f08db7ea128 (diff) | |
download | llvm-6641657453170b57d05de8aea095b0f41f7ba4fe.zip llvm-6641657453170b57d05de8aea095b0f41f7ba4fe.tar.gz llvm-6641657453170b57d05de8aea095b0f41f7ba4fe.tar.bz2 |
[AMDGPU] Add an AMDGPU specific atomic optimizer.
This commit adds a new IR level pass to the AMDGPU backend to perform
atomic optimizations. It works by:
- Running through a function and finding atomicrmw add/sub or uses of
the atomic buffer intrinsics for add/sub.
- If all arguments except the value to be added/subtracted are uniform,
record the value to be optimized.
- Run through the atomic operations we can optimize and, depending on
whether the value is uniform/divergent use wavefront wide operations
(DPP in the divergent case) to calculate the total amount to be
atomically added/subtracted.
- Then let only a single lane of each wavefront perform the atomic
operation, reducing the total number of atomic operations in flight.
- Lastly we recombine the result from the single lane to each lane of
the wavefront, and calculate our individual lanes offset into the
final result.
Differential Revision: https://reviews.llvm.org/D51969
llvm-svn: 343973
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
0 files changed, 0 insertions, 0 deletions