LLVM 23.0.0git
AMDGPULowerKernelAttributes.cpp File Reference
#include "AMDGPU.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Pass.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "amdgpu-lower-kernel-attributes"

Functions

static bool annotateGridSizeLoadWithRangeMD (LoadInst *Load, uint32_t MaxNumGroups)
static bool annotateGroupSizeLoadWithRangeMD (LoadInst *Load, bool IsRemainder)
static bool annotateGridDimsLoadWithRangeMD (LoadInst *Load, unsigned KnownNumGridDims)
static unsigned computeNumGridDims (const MDNode *ReqdWorkGroupSize)
 Compute the number of grid dimensions based on !reqd_work_group_size metadata.
static bool processUse (CallInst *CI, bool IsV5OrAbove)
 INITIALIZE_PASS_BEGIN (AMDGPULowerKernelAttributes, DEBUG_TYPE, "AMDGPU Kernel Attributes", false, false) INITIALIZE_PASS_END(AMDGPULowerKernelAttributes

Variables

 DEBUG_TYPE
AMDGPU Kernel Attributes
AMDGPU Kernel false

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-lower-kernel-attributes"

Definition at line 30 of file AMDGPULowerKernelAttributes.cpp.

Function Documentation

◆ annotateGridDimsLoadWithRangeMD()

bool annotateGridDimsLoadWithRangeMD ( LoadInst * Load,
unsigned KnownNumGridDims )
static

Definition at line 121 of file AMDGPULowerKernelAttributes.cpp.

References llvm::MDBuilder::createRange(), llvm::dyn_cast(), and Range.

Referenced by processUse().

◆ annotateGridSizeLoadWithRangeMD()

bool annotateGridSizeLoadWithRangeMD ( LoadInst * Load,
uint32_t MaxNumGroups )
static

Definition at line 87 of file AMDGPULowerKernelAttributes.cpp.

References llvm::MDBuilder::createRange(), and Range.

Referenced by processUse().

◆ annotateGroupSizeLoadWithRangeMD()

bool annotateGroupSizeLoadWithRangeMD ( LoadInst * Load,
bool IsRemainder )
static

◆ computeNumGridDims()

unsigned computeNumGridDims ( const MDNode * ReqdWorkGroupSize)
static

Compute the number of grid dimensions based on !reqd_work_group_size metadata.

Definition at line 146 of file AMDGPULowerKernelAttributes.cpp.

References llvm::mdconst::extract(), and llvm::ConstantInt::getZExtValue().

Referenced by processUse().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( AMDGPULowerKernelAttributes ,
DEBUG_TYPE ,
"AMDGPU Kernel Attributes" ,
false ,
false  )

References DEBUG_TYPE.

◆ processUse()

Variable Documentation

◆ Attributes

AMDGPU Kernel Attributes

Definition at line 493 of file AMDGPULowerKernelAttributes.cpp.

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 492 of file AMDGPULowerKernelAttributes.cpp.

◆ false

AMDGPU Kernel false

Definition at line 493 of file AMDGPULowerKernelAttributes.cpp.