LLVM 17.0.0git
Macros | Functions | Variables
AMDGPUCodeGenPrepare.cpp File Reference

This pass does misc. More...

#include "AMDGPU.h"
#include "AMDGPUTargetMachine.h"
#include "SIModeRegisterDefaults.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/UniformityAnalysis.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Transforms/Utils/IntegerDivision.h"
Include dependency graph for AMDGPUCodeGenPrepare.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "amdgpu-codegenprepare"
 

Functions

static bool promotedOpIsNSW (const Instruction &I)
 
static bool promotedOpIsNUW (const Instruction &I)
 
static void extractValues (IRBuilder<> &Builder, SmallVectorImpl< Value * > &Values, Value *V)
 
static ValueinsertValues (IRBuilder<> &Builder, Type *Ty, SmallVectorImpl< Value * > &Values)
 
static ValuegetMul24 (IRBuilder<> &Builder, Value *LHS, Value *RHS, unsigned Size, unsigned NumBits, bool IsSigned)
 
static SelectInstfindSelectThroughCast (Value *V, CastInst *&Cast)
 
static ValueoptimizeWithRcp (Value *Num, Value *Den, bool AllowInaccurateRcp, bool RcpIsAccurate, IRBuilder<> &Builder, Module *Mod)
 
static ValueoptimizeWithFDivFast (Value *Num, Value *Den, float ReqdAccuracy, bool HasDenormals, IRBuilder<> &Builder, Module *Mod)
 
static bool hasUnsafeFPMath (const Function &F)
 
static std::pair< Value *, Value * > getMul64 (IRBuilder<> &Builder, Value *LHS, Value *RHS)
 
static ValuegetMulHu (IRBuilder<> &Builder, Value *LHS, Value *RHS)
 
static ValuegetSign32 (Value *V, IRBuilder<> &Builder, const DataLayout *DL)
 
 INITIALIZE_PASS_BEGIN (AMDGPUCodeGenPrepare, DEBUG_TYPE, "AMDGPU IR optimizations", false, false) INITIALIZE_PASS_END(AMDGPUCodeGenPrepare
 

Variables

 DEBUG_TYPE
 
AMDGPU IR optimizations
 
AMDGPU IR false
 

Detailed Description

This pass does misc.

AMDGPU optimizations on IR before instruction selection.

Definition in file AMDGPUCodeGenPrepare.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-codegenprepare"

Definition at line 32 of file AMDGPUCodeGenPrepare.cpp.

Function Documentation

◆ extractValues()

static void extractValues ( IRBuilder<> &  Builder,
SmallVectorImpl< Value * > &  Values,
Value V 
)
static

◆ findSelectThroughCast()

static SelectInst * findSelectThroughCast ( Value V,
CastInst *&  Cast 
)
static

Definition at line 594 of file AMDGPUCodeGenPrepare.cpp.

References llvm::User::getOperand().

◆ getMul24()

static Value * getMul24 ( IRBuilder<> &  Builder,
Value LHS,
Value RHS,
unsigned  Size,
unsigned  NumBits,
bool  IsSigned 
)
static

◆ getMul64()

static std::pair< Value *, Value * > getMul64 ( IRBuilder<> &  Builder,
Value LHS,
Value RHS 
)
static

Definition at line 876 of file AMDGPUCodeGenPrepare.cpp.

References Builder, llvm::Hi, LHS, llvm::Lo, and RHS.

Referenced by getMulHu().

◆ getMulHu()

static Value * getMulHu ( IRBuilder<> &  Builder,
Value LHS,
Value RHS 
)
static

Definition at line 890 of file AMDGPUCodeGenPrepare.cpp.

References Builder, getMul64(), LHS, and RHS.

◆ getSign32()

static Value * getSign32 ( Value V,
IRBuilder<> &  Builder,
const DataLayout DL 
)
static

◆ hasUnsafeFPMath()

static bool hasUnsafeFPMath ( const Function F)
static

Definition at line 871 of file AMDGPUCodeGenPrepare.cpp.

References F, and llvm::Attribute::getValueAsBool().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( AMDGPUCodeGenPrepare  ,
DEBUG_TYPE  ,
"AMDGPU IR optimizations"  ,
false  ,
false   
)

◆ insertValues()

static Value * insertValues ( IRBuilder<> &  Builder,
Type Ty,
SmallVectorImpl< Value * > &  Values 
)
static

◆ optimizeWithFDivFast()

static Value * optimizeWithFDivFast ( Value Num,
Value Den,
float  ReqdAccuracy,
bool  HasDenormals,
IRBuilder<> &  Builder,
Module Mod 
)
static

◆ optimizeWithRcp()

static Value * optimizeWithRcp ( Value Num,
Value Den,
bool  AllowInaccurateRcp,
bool  RcpIsAccurate,
IRBuilder<> &  Builder,
Module Mod 
)
static

◆ promotedOpIsNSW()

static bool promotedOpIsNSW ( const Instruction I)
static

Definition at line 295 of file AMDGPUCodeGenPrepare.cpp.

References I.

◆ promotedOpIsNUW()

static bool promotedOpIsNUW ( const Instruction I)
static

Definition at line 309 of file AMDGPUCodeGenPrepare.cpp.

References I.

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 1574 of file AMDGPUCodeGenPrepare.cpp.

◆ false

AMDGPU IR false

Definition at line 1575 of file AMDGPUCodeGenPrepare.cpp.

◆ optimizations

AMDGPU IR optimizations

Definition at line 1574 of file AMDGPUCodeGenPrepare.cpp.