[PATCH] D157265: [AMDGPU] Reorder atomic optimizer to avoid CAS loop.

Pravin Jagtap via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 04:31:31 PDT 2023


pravinjagtap added a comment.

In D157265#4565049 <https://reviews.llvm.org/D157265#4565049>, @foad wrote:

>> Expand-Atomic pass emits the CAS loop for FP operations
>> which limits the optimizations offered by atomic optimizer.
>>
>> Moving atomic optimizer before expand-atomics allows
>> better codegen.
>
> So the intention is that you still get a CAS loop, but the whole loop is executed by a single lane, instead of switching into and out of single-lane mode each time around the loop?

At the moment, yes, that the current behavior. As a extension, will be creating new patch where atomic-expand calls `simplifyCFG` on the relevant blocks if it emits a CAS loop. [suggested by @arsenm]


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157265/new/

https://reviews.llvm.org/D157265



More information about the llvm-commits mailing list