LLVM 20.0.0git
Macros | Functions | Variables
AMDGPUPerfHintAnalysis.cpp File Reference

Analyzes if a function potentially memory bound and if a kernel kernel may benefit from limiting number of waves to reduce cache thrashing. More...

#include "AMDGPUPerfHintAnalysis.h"
#include "AMDGPU.h"
#include "AMDGPUTargetMachine.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/CallGraphSCCPass.h"
#include "llvm/Analysis/LazyCallGraph.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetMachine.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "amdgpu-perf-hint"
 

Functions

 STATISTIC (NumMemBound, "Number of functions marked as memory bound")
 
 STATISTIC (NumLimitWave, "Number of functions marked as needing limit wave")
 
 INITIALIZE_PASS (AMDGPUPerfHintAnalysisLegacy, DEBUG_TYPE, "Analysis if a function is memory bound", true, true) bool AMDGPUPerfHintAnalysisLegacy
 

Variables

static cl::opt< unsignedMemBoundThresh ("amdgpu-membound-threshold", cl::init(50), cl::Hidden, cl::desc("Function mem bound threshold in %"))
 
static cl::opt< unsignedLimitWaveThresh ("amdgpu-limit-wave-threshold", cl::init(50), cl::Hidden, cl::desc("Kernel limit wave threshold in %"))
 
static cl::opt< unsignedIAWeight ("amdgpu-indirect-access-weight", cl::init(1000), cl::Hidden, cl::desc("Indirect access memory instruction weight"))
 
static cl::opt< unsignedLSWeight ("amdgpu-large-stride-weight", cl::init(1000), cl::Hidden, cl::desc("Large stride memory access weight"))
 
static cl::opt< unsignedLargeStrideThresh ("amdgpu-large-stride-threshold", cl::init(64), cl::Hidden, cl::desc("Large stride memory access threshold"))
 

Detailed Description

Analyzes if a function potentially memory bound and if a kernel kernel may benefit from limiting number of waves to reduce cache thrashing.

Definition in file AMDGPUPerfHintAnalysis.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-perf-hint"

Definition at line 35 of file AMDGPUPerfHintAnalysis.cpp.

Function Documentation

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( AMDGPUPerfHintAnalysisLegacy  ,
DEBUG_TYPE  ,
"Analysis if a function is memory bound"  ,
true  ,
true   
)

Definition at line 470 of file AMDGPUPerfHintAnalysis.cpp.

◆ STATISTIC() [1/2]

STATISTIC ( NumLimitWave  ,
"Number of functions marked as needing limit wave"   
)

◆ STATISTIC() [2/2]

STATISTIC ( NumMemBound  ,
"Number of functions marked as memory bound"   
)

Variable Documentation

◆ IAWeight

cl::opt< unsigned > IAWeight("amdgpu-indirect-access-weight", cl::init(1000), cl::Hidden, cl::desc("Indirect access memory instruction weight")) ( "amdgpu-indirect-access-weight"  ,
cl::init(1000)  ,
cl::Hidden  ,
cl::desc("Indirect access memory instruction weight")   
)
static

◆ LargeStrideThresh

cl::opt< unsigned > LargeStrideThresh("amdgpu-large-stride-threshold", cl::init(64), cl::Hidden, cl::desc("Large stride memory access threshold")) ( "amdgpu-large-stride-threshold"  ,
cl::init(64)  ,
cl::Hidden  ,
cl::desc("Large stride memory access threshold")   
)
static

◆ LimitWaveThresh

cl::opt< unsigned > LimitWaveThresh("amdgpu-limit-wave-threshold", cl::init(50), cl::Hidden, cl::desc("Kernel limit wave threshold in %")) ( "amdgpu-limit-wave-threshold"  ,
cl::init(50)  ,
cl::Hidden  ,
cl::desc("Kernel limit wave threshold in %")   
)
static

◆ LSWeight

cl::opt< unsigned > LSWeight("amdgpu-large-stride-weight", cl::init(1000), cl::Hidden, cl::desc("Large stride memory access weight")) ( "amdgpu-large-stride-weight"  ,
cl::init(1000)  ,
cl::Hidden  ,
cl::desc("Large stride memory access weight")   
)
static

◆ MemBoundThresh

cl::opt< unsigned > MemBoundThresh("amdgpu-membound-threshold", cl::init(50), cl::Hidden, cl::desc("Function mem bound threshold in %")) ( "amdgpu-membound-threshold"  ,
cl::init(50)  ,
cl::Hidden  ,
cl::desc("Function mem bound threshold in %")   
)
static