LLVM 20.0.0git
|
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...
#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/UniformityAnalysis.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/InitializePasses.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
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 Value * | buildNonAtomicBinOp (IRBuilder<> &B, AtomicRMWInst::BinOp Op, Value *LHS, Value *RHS) |
static Constant * | getIdentityValueForAtomicOp (Type *const Ty, AtomicRMWInst::BinOp Op) |
static Value * | buildMul (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 |
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
Definition in file AMDGPUAtomicOptimizer.cpp.
#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.
Definition at line 649 of file AMDGPUAtomicOptimizer.cpp.
References B, llvm::ConstantInt::isOne(), LHS, and RHS.
|
static |
Definition at line 351 of file AMDGPUAtomicOptimizer.cpp.
References llvm::AtomicRMWInst::Add, llvm::AtomicRMWInst::And, B, Cond, llvm::AtomicRMWInst::FAdd, llvm::AtomicRMWInst::FMax, llvm::AtomicRMWInst::FMin, llvm::AtomicRMWInst::FSub, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULT, LHS, llvm_unreachable, llvm::AtomicRMWInst::Max, llvm::AtomicRMWInst::Min, llvm::AtomicRMWInst::Or, RHS, llvm::AtomicRMWInst::Sub, llvm::AtomicRMWInst::UMax, llvm::AtomicRMWInst::UMin, and llvm::AtomicRMWInst::Xor.
|
static |
Definition at line 615 of file AMDGPUAtomicOptimizer.cpp.
References llvm::AtomicRMWInst::Add, llvm::AtomicRMWInst::And, llvm::BitWidth, llvm::CallingConv::C, llvm::AtomicRMWInst::FAdd, llvm::AtomicRMWInst::FMax, llvm::AtomicRMWInst::FMin, llvm::AtomicRMWInst::FSub, llvm::Type::getContext(), llvm::Type::getFltSemantics(), llvm::APInt::getMaxValue(), llvm::APInt::getMinValue(), llvm::APFloat::getNaN(), llvm::Type::getPrimitiveSizeInBits(), llvm::APInt::getSignedMaxValue(), llvm::APInt::getSignedMinValue(), llvm::APFloat::getZero(), llvm_unreachable, llvm::AtomicRMWInst::Max, llvm::AtomicRMWInst::Min, llvm::AtomicRMWInst::Or, llvm::AtomicRMWInst::Sub, llvm::AtomicRMWInst::UMax, llvm::AtomicRMWInst::UMin, and llvm::AtomicRMWInst::Xor.
INITIALIZE_PASS_BEGIN | ( | AMDGPUAtomicOptimizer | , |
DEBUG_TYPE | , | ||
"AMDGPU atomic optimizations" | , | ||
false | , | ||
false | |||
) |
Definition at line 173 of file AMDGPUAtomicOptimizer.cpp.
References llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::Type::getIntegerBitWidth(), llvm::Type::getTypeID(), llvm::Type::IntegerTyID, and Size.
DEBUG_TYPE |
Definition at line 985 of file AMDGPUAtomicOptimizer.cpp.
AMDGPU atomic false |
Definition at line 986 of file AMDGPUAtomicOptimizer.cpp.
AMDGPU atomic optimizations |
Definition at line 986 of file AMDGPUAtomicOptimizer.cpp.