LLVM 17.0.0git
|
#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"
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 FixedVectorType * | arrayTypeToVecType (ArrayType *ArrayTy) |
static Value * | calculateVectorIndex (Value *Ptr, const std::map< GetElementPtrInst *, Value * > &GEPIdx) |
static Value * | GEPToVectorIndex (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 |
#define DEBUG_TYPE "amdgpu-promote-alloca" |
Definition at line 27 of file AMDGPUPromoteAlloca.cpp.
|
static |
Definition at line 332 of file AMDGPUPromoteAlloca.cpp.
References llvm::FixedVectorType::get().
Referenced by tryPromoteAllocaToVector().
|
static |
Definition at line 338 of file AMDGPUPromoteAlloca.cpp.
References assert(), GEP, llvm::Type::getInt32Ty(), llvm::Constant::getNullValue(), I, and Ptr.
Referenced by tryPromoteAllocaToVector().
|
static |
Definition at line 349 of file AMDGPUPromoteAlloca.cpp.
References DL, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::front(), GEP, llvm::ConstantInt::get(), llvm::APInt::isZero(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::size(), and llvm::APInt::udivrem().
Referenced by tryPromoteAllocaToVector().
bool handlePromoteAllocaToVector | ( | AllocaInst & | I, |
unsigned | MaxVGPRs | ||
) |
Definition at line 1158 of file AMDGPUPromoteAlloca.cpp.
References llvm::dbgs(), I, LLVM_DEBUG, llvm::Mod, and tryPromoteAllocaToVector().
Referenced by promoteAllocasToVector().
INITIALIZE_PASS_BEGIN | ( | AMDGPUPromoteAlloca | , |
DEBUG_TYPE | , | ||
"AMDGPU promote alloca to vector or LDS" | , | ||
false | , | ||
false | |||
) |
Definition at line 625 of file AMDGPUPromoteAlloca.cpp.
References llvm::IntrinsicInst::getIntrinsicID().
bool promoteAllocasToVector | ( | Function & | F, |
TargetMachine & | TM | ||
) |
Definition at line 1170 of file AMDGPUPromoteAlloca.cpp.
References llvm::Triple::amdgcn, F, llvm::AMDGPUSubtarget::get(), handlePromoteAllocaToVector(), I, llvm::AMDGPU::isEntryFunctionCC(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TM.
Referenced by llvm::AMDGPUPromoteAllocaToVectorPass::run().
|
static |
Definition at line 387 of file AMDGPUPromoteAlloca.cpp.
References llvm::all_of(), arrayTypeToVecType(), assert(), Builder, calculateVectorIndex(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::dbgs(), MemTransferInfo::DestIndex, DL, llvm::SmallVectorBase< Size_T >::empty(), GEP, GEPToVectorIndex(), llvm::AllocaInst::getAddressSpace(), llvm::AllocaInst::getAlign(), llvm::AllocaInst::getAllocatedType(), llvm::getLoadStorePointerOperand(), llvm::getLoadStoreType(), llvm::StoreInst::getPointerOperandIndex(), llvm::Type::getPointerTo(), llvm::Value::getType(), llvm::ConstantInt::getZExtValue(), Idx, Info, llvm::isAssumeLikeIntrinsic(), llvm::CastInst::isBitOrNoopPointerCastable(), llvm::VectorType::isValidElementType(), llvm::Length, LLVM_DEBUG, llvm_unreachable, llvm::SmallVectorImpl< T >::pop_back_val(), Ptr, llvm::SmallVectorTemplateBase< T, bool >::push_back(), SI, MemTransferInfo::SrcIndex, llvm::Value::users(), llvm::Value::uses(), and Uses.
Referenced by handlePromoteAllocaToVector().
DEBUG_TYPE |
Definition at line 136 of file AMDGPUPromoteAlloca.cpp.
AMDGPU promote alloca to vector or false |
Definition at line 137 of file AMDGPUPromoteAlloca.cpp.
AMDGPU promote alloca to vector or LDS |
Definition at line 137 of file AMDGPUPromoteAlloca.cpp.
Referenced by llvm::AMDGPUTargetLowering::getTargetNodeName().