LLVM 20.0.0git
|
#include "AMDGPU.h"
#include "AMDGPUInstrInfo.h"
#include "AMDGPUTargetMachine.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/Pass.h"
#include "llvm/Support/raw_ostream.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "amdgpu-image-intrinsic-opt" |
Functions | |
INITIALIZE_PASS(AMDGPUImageIntrinsicOptimizer, DEBUG_TYPE, "AMDGPU Image Intrinsic Optimizer", false, false) char AMDGPUImageIntrinsicOptimizer void | addInstToMergeableList (IntrinsicInst *II, SmallVector< SmallVector< IntrinsicInst *, 4 > > &MergeableInsts, const AMDGPU::ImageDimIntrinsicInfo *ImageDimIntr) |
BasicBlock::iterator | collectMergeableInsts (BasicBlock::iterator I, BasicBlock::iterator E, SmallVector< SmallVector< IntrinsicInst *, 4 > > &MergeableInsts) |
bool | optimizeSection (ArrayRef< SmallVector< IntrinsicInst *, 4 > > MergeableInsts) |
static bool | imageIntrinsicOptimizerImpl (Function &F, const TargetMachine *TM) |
#define DEBUG_TYPE "amdgpu-image-intrinsic-opt" |
Definition at line 76 of file AMDGPUImageIntrinsicOptimizer.cpp.
INITIALIZE_PASS(AMDGPUImageIntrinsicOptimizer, DEBUG_TYPE, "AMDGPU Image Intrinsic Optimizer", false, false) char AMDGPUImageIntrinsicOptimizer void addInstToMergeableList | ( | IntrinsicInst * | II, |
SmallVector< SmallVector< IntrinsicInst *, 4 > > & | MergeableInsts, | ||
const AMDGPU::ImageDimIntrinsicInfo * | ImageDimIntr | ||
) |
Definition at line 98 of file AMDGPUImageIntrinsicOptimizer.cpp.
References assert(), llvm::dbgs(), I, II, and LLVM_DEBUG.
Referenced by collectMergeableInsts().
BasicBlock::iterator collectMergeableInsts | ( | BasicBlock::iterator | I, |
BasicBlock::iterator | E, | ||
SmallVector< SmallVector< IntrinsicInst *, 4 > > & | MergeableInsts | ||
) |
Definition at line 142 of file AMDGPUImageIntrinsicOptimizer.cpp.
References addInstToMergeableList(), llvm::dbgs(), llvm::AMDGPU::getImageDimIntrinsicInfo(), I, II, and LLVM_DEBUG.
Referenced by imageIntrinsicOptimizerImpl().
|
static |
Definition at line 284 of file AMDGPUImageIntrinsicOptimizer.cpp.
References collectMergeableInsts(), F, I, llvm::AMDGPU::isGFX11Plus(), Modified, llvm::none_of(), optimizeSection(), and TM.
Referenced by llvm::AMDGPUImageIntrinsicOptimizerPass::run().
bool optimizeSection | ( | ArrayRef< SmallVector< IntrinsicInst *, 4 > > | MergeableInsts | ) |
Definition at line 176 of file AMDGPUImageIntrinsicOptimizer.cpp.
References B, llvm::countr_zero(), llvm::dbgs(), llvm::divideCeil(), llvm::AMDGPU::ImageDimIntrinsicInfo::DMaskIndex, F, llvm::FixedVectorType::get(), llvm::UndefValue::get(), llvm::Intrinsic::getDeclaration(), llvm::AMDGPU::getImageDimIntrinsicInfo(), llvm::Intrinsic::getIntrinsicSignature(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::ConstantInt::getZExtValue(), I, Idx, II, llvm::Type::isHalfTy(), LLVM_DEBUG, Modified, llvm::popcount(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Value::takeName(), llvm::APInt::udiv(), and llvm::AMDGPU::ImageDimIntrinsicInfo::VAddrEnd.
Referenced by imageIntrinsicOptimizerImpl().