LLVM  14.0.0git
Macros | Functions | Variables
AMDGPUCodeGenPrepare.cpp File Reference
#include "AMDGPU.h"
#include "AMDGPUTargetMachine.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/LegacyDivergenceAnalysis.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/IR/IRBuilder.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 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 31 of file AMDGPUCodeGenPrepare.cpp.

Function Documentation

◆ extractValues()

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

Definition at line 455 of file AMDGPUCodeGenPrepare.cpp.

References Builder, E, llvm::Value::getType(), and I.

◆ findSelectThroughCast()

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

Definition at line 564 of file AMDGPUCodeGenPrepare.cpp.

References llvm::User::getOperand().

◆ getMul64()

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

Definition at line 846 of file AMDGPUCodeGenPrepare.cpp.

References Builder, llvm::MipsISD::Hi, and llvm::MipsISD::Lo.

Referenced by getMulHu().

◆ getMulHu()

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

Definition at line 860 of file AMDGPUCodeGenPrepare.cpp.

References Builder, and getMul64().

◆ getSign32()

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

◆ hasUnsafeFPMath()

static bool hasUnsafeFPMath ( const Function F)
static

Definition at line 841 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

Definition at line 467 of file AMDGPUCodeGenPrepare.cpp.

References Builder, E, llvm::UndefValue::get(), and I.

◆ 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 277 of file AMDGPUCodeGenPrepare.cpp.

References llvm::MCID::Add, and I.

◆ promotedOpIsNUW()

static bool promotedOpIsNUW ( const Instruction I)
static

Definition at line 291 of file AMDGPUCodeGenPrepare.cpp.

References llvm::MCID::Add, and I.

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 1444 of file AMDGPUCodeGenPrepare.cpp.

◆ false

AMDGPU IR false

Definition at line 1445 of file AMDGPUCodeGenPrepare.cpp.

◆ optimizations

AMDGPU IR optimizations

Definition at line 1444 of file AMDGPUCodeGenPrepare.cpp.