[PATCH] D147408: [AMDGPU] Enable AMDGPU Atomic Optimizer Pass by default.

Christudasan Devadasan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 11:44:18 PDT 2023


cdevadas added a comment.

Need a test for device functions.



================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp:609
         Op == AtomicRMWInst::Sub ? AtomicRMWInst::Add : Op;
-    if (!NeedResult && ST->hasPermLaneX16()) {
-      // On GFX10 the permlanex16 instruction helps us build a reduction without
-      // too many readlanes and writelanes, which are generally bad for
-      // performance.
-      NewV = buildReduction(B, ScanOp, NewV, Identity);
+    if (IsGraphicsShader) {
+      // First we need to set all inactive invocations to the identity value, so
----------------
I'm not sure if this should get enabled for all graphics CCs. @foad can you confirm?


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:276
+                              cl::desc("Enable atomic optimizations"),
+                              cl::init(true), cl::Hidden);
 
----------------
You're turning this flag on by default and it is going to change the default behavior for shaders. Can you run the shader tests too?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147408



More information about the llvm-commits mailing list