LLVM 22.0.0git
AMDGPUAtomicOptimizer.cpp File Reference

This pass optimizes atomic operations by using a single lane of a wavefront to perform the atomic operation, thus reducing contention on that memory location. More...

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "amdgpu-atomic-optimizer"
 of Wavefront using llvm.cttz and performs scan using readlane & writelane intrinsics

Functions

static bool isLegalCrossLaneType (Type *Ty)
static ValuebuildNonAtomicBinOp (IRBuilder<> &B, AtomicRMWInst::BinOp Op, Value *LHS, Value *RHS)
static ConstantgetIdentityValueForAtomicOp (Type *const Ty, AtomicRMWInst::BinOp Op)
static ValuebuildMul (IRBuilder<> &B, Value *LHS, Value *RHS)
 INITIALIZE_PASS_BEGIN (AMDGPUAtomicOptimizer, DEBUG_TYPE, "AMDGPU atomic optimizations", false, false) INITIALIZE_PASS_END(AMDGPUAtomicOptimizer

Variables

 DEBUG_TYPE
AMDGPU atomic optimizations
AMDGPU atomic false

Detailed Description

This pass optimizes atomic operations by using a single lane of a wavefront to perform the atomic operation, thus reducing contention on that memory location.

Atomic optimizer uses following strategies to compute scan and reduced values

  1. DPP - This is the most efficient implementation for scan. DPP uses Whole Wave Mode (WWM)
  2. Iterative -

Definition in file AMDGPUAtomicOptimizer.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-atomic-optimizer"

of Wavefront using llvm.cttz and performs scan using readlane & writelane intrinsics

Definition at line 36 of file AMDGPUAtomicOptimizer.cpp.

Function Documentation

◆ buildMul()

Value * buildMul ( IRBuilder<> & B,
Value * LHS,
Value * RHS )
static

Definition at line 639 of file AMDGPUAtomicOptimizer.cpp.

References B(), llvm::dyn_cast(), llvm::ConstantInt::isOne(), LHS, and RHS.

◆ buildNonAtomicBinOp()

◆ getIdentityValueForAtomicOp()

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( AMDGPUAtomicOptimizer ,
DEBUG_TYPE ,
"AMDGPU atomic optimizations" ,
false ,
false  )

◆ isLegalCrossLaneType()

bool isLegalCrossLaneType ( Type * Ty)
static

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 981 of file AMDGPUAtomicOptimizer.cpp.

◆ false

AMDGPU atomic false

Definition at line 982 of file AMDGPUAtomicOptimizer.cpp.

◆ optimizations

AMDGPU atomic optimizations

Definition at line 982 of file AMDGPUAtomicOptimizer.cpp.