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

Pravin Jagtap via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 2 02:16:36 PDT 2023


pravinjagtap created this revision.
pravinjagtap added reviewers: b-sumner, foad, arsenm, cdevadas.
Herald added subscribers: kosarev, StephenFan, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
pravinjagtap requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

This patch enables the AMDGPU atomic optimizations by default and
provides an alternative implementation to DPP for Scan Computations.

An alternative implementation iterates over all the lanes and performs
the following steps:

1. Read the value that needs to be atomically incremented using llvm.amdgcn.readlane intrinsic
2. Select either the Identity (if the lane is inactive) or a result of step 1 in scan computation based on whether the lane is active or not.
3. Update the scan result conditionally if the lane is active and an intermediate scan result is needed later in the kernel using llvm.amdgcn.writelane intrinsic


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147408

Files:
  llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/mubuf-global.ll
  llvm/test/CodeGen/AMDGPU/atomic_optimizations_buffer.ll
  llvm/test/CodeGen/AMDGPU/atomic_optimizations_global_pointer.ll
  llvm/test/CodeGen/AMDGPU/atomic_optimizations_local_pointer.ll
  llvm/test/CodeGen/AMDGPU/atomic_optimizations_raw_buffer.ll
  llvm/test/CodeGen/AMDGPU/atomic_optimizations_struct_buffer.ll
  llvm/test/CodeGen/AMDGPU/buffer-intrinsics-mmo-offsets.ll
  llvm/test/CodeGen/AMDGPU/dag-divergence-atomic.ll
  llvm/test/CodeGen/AMDGPU/gds-allocation.ll
  llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
  llvm/test/CodeGen/AMDGPU/noclobber-barrier.ll



More information about the llvm-commits mailing list