LLVM 17.0.0git
Classes | Macros | Functions | Variables
AMDGPUPromoteAlloca.cpp File Reference
#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/Analysis/CaptureTracking.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.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.

Classes

struct  MemTransferInfo
 

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 ValuecalculateVectorIndex (Value *Ptr, const std::map< GetElementPtrInst *, Value * > &GEPIdx)
 
static ValueGEPToVectorIndex (GetElementPtrInst *GEP, AllocaInst *Alloca, Type *VecElemTy, 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 27 of file AMDGPUPromoteAlloca.cpp.

Function Documentation

◆ arrayTypeToVecType()

static FixedVectorType * arrayTypeToVecType ( ArrayType ArrayTy)
static

Definition at line 332 of file AMDGPUPromoteAlloca.cpp.

References llvm::FixedVectorType::get().

Referenced by tryPromoteAllocaToVector().

◆ calculateVectorIndex()

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

◆ GEPToVectorIndex()

static Value * GEPToVectorIndex ( GetElementPtrInst GEP,
AllocaInst Alloca,
Type VecElemTy,
const DataLayout DL 
)
static

◆ 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 625 of file AMDGPUPromoteAlloca.cpp.

References llvm::IntrinsicInst::getIntrinsicID().

◆ promoteAllocasToVector()

bool promoteAllocasToVector ( Function F,
TargetMachine TM 
)

◆ tryPromoteAllocaToVector()

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

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 136 of file AMDGPUPromoteAlloca.cpp.

◆ false

AMDGPU promote alloca to vector or false

Definition at line 137 of file AMDGPUPromoteAlloca.cpp.

◆ LDS

AMDGPU promote alloca to vector or LDS