LLVM  14.0.0git
Macros | Functions | Variables
AMDGPUPromoteAlloca.cpp File Reference
#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "llvm/Analysis/CaptureTracking.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/IR/IntrinsicsR600.h"
#include "llvm/Pass.h"
#include "llvm/Target/TargetMachine.h"
Include dependency graph for AMDGPUPromoteAlloca.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "amdgpu-promote-alloca"
 

Functions

 INITIALIZE_PASS_BEGIN (AMDGPUPromoteAlloca, DEBUG_TYPE, "AMDGPU promote alloca to vector or LDS", false, false) INITIALIZE_PASS_END(AMDGPUPromoteAlloca
 
static FixedVectorTypearrayTypeToVecType (ArrayType *ArrayTy)
 
static ValuestripBitcasts (Value *V)
 
static ValuecalculateVectorIndex (Value *Ptr, const std::map< GetElementPtrInst *, Value * > &GEPIdx)
 
static ValueGEPToVectorIndex (GetElementPtrInst *GEP)
 
static bool canVectorizeInst (Instruction *Inst, User *User, const DataLayout &DL)
 
static bool tryPromoteAllocaToVector (AllocaInst *Alloca, const DataLayout &DL, unsigned MaxVGPRs)
 
static bool isCallPromotable (CallInst *CI)
 
bool handlePromoteAllocaToVector (AllocaInst &I, unsigned MaxVGPRs)
 
bool promoteAllocasToVector (Function &F, TargetMachine &TM)
 

Variables

 DEBUG_TYPE
 
AMDGPU promote alloca to vector or LDS
 
AMDGPU promote alloca to vector or false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-promote-alloca"

Definition at line 25 of file AMDGPUPromoteAlloca.cpp.

Function Documentation

◆ arrayTypeToVecType()

static FixedVectorType* arrayTypeToVecType ( ArrayType ArrayTy)
static

◆ calculateVectorIndex()

static Value* calculateVectorIndex ( Value Ptr,
const std::map< GetElementPtrInst *, Value * > &  GEPIdx 
)
static

Definition at line 335 of file AMDGPUPromoteAlloca.cpp.

References GEP, I, and stripBitcasts().

Referenced by tryPromoteAllocaToVector().

◆ canVectorizeInst()

static bool canVectorizeInst ( Instruction Inst,
User User,
const DataLayout DL 
)
static

◆ GEPToVectorIndex()

static Value* GEPToVectorIndex ( GetElementPtrInst GEP)
static

Definition at line 345 of file AMDGPUPromoteAlloca.cpp.

References GEP, and llvm::ConstantInt::isZero().

Referenced by tryPromoteAllocaToVector().

◆ handlePromoteAllocaToVector()

bool handlePromoteAllocaToVector ( AllocaInst I,
unsigned  MaxVGPRs 
)

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( AMDGPUPromoteAlloca  ,
DEBUG_TYPE  ,
"AMDGPU promote alloca to vector or LDS ,
false  ,
false   
)

◆ isCallPromotable()

static bool isCallPromotable ( CallInst CI)
static

Definition at line 552 of file AMDGPUPromoteAlloca.cpp.

References llvm::IntrinsicInst::getIntrinsicID(), and memcpy().

◆ promoteAllocasToVector()

bool promoteAllocasToVector ( Function F,
TargetMachine TM 
)

◆ stripBitcasts()

static Value* stripBitcasts ( Value V)
static

Definition at line 325 of file AMDGPUPromoteAlloca.cpp.

References I.

Referenced by calculateVectorIndex().

◆ tryPromoteAllocaToVector()

static bool tryPromoteAllocaToVector ( AllocaInst Alloca,
const DataLayout DL,
unsigned  MaxVGPRs 
)
static

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 134 of file AMDGPUPromoteAlloca.cpp.

◆ false

AMDGPU promote alloca to vector or false

Definition at line 135 of file AMDGPUPromoteAlloca.cpp.

◆ LDS

AMDGPU promote alloca to vector or LDS

Definition at line 135 of file AMDGPUPromoteAlloca.cpp.