LLVM  8.0.1
Macros | Functions
AMDGPUPromoteAlloca.cpp File Reference
#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/CaptureTracking.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <map>
#include <tuple>
#include <utility>
#include <vector>
Include dependency graph for AMDGPUPromoteAlloca.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "amdgpu-promote-alloca"
 

Functions

static VectorTypearrayTypeToVecType (ArrayType *ArrayTy)
 
static ValuecalculateVectorIndex (Value *Ptr, const std::map< GetElementPtrInst *, Value *> &GEPIdx)
 
static ValueGEPToVectorIndex (GetElementPtrInst *GEP)
 
static bool canVectorizeInst (Instruction *Inst, User *User)
 
static bool tryPromoteAllocaToVector (AllocaInst *Alloca)
 
static bool isCallPromotable (CallInst *CI)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-promote-alloca"

Definition at line 62 of file AMDGPUPromoteAlloca.cpp.

Function Documentation

◆ arrayTypeToVecType()

static VectorType* arrayTypeToVecType ( ArrayType ArrayTy)
static

◆ calculateVectorIndex()

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

Definition at line 301 of file AMDGPUPromoteAlloca.cpp.

References GEP, and I.

Referenced by tryPromoteAllocaToVector().

◆ canVectorizeInst()

static bool canVectorizeInst ( Instruction Inst,
User User 
)
static

◆ GEPToVectorIndex()

static Value* GEPToVectorIndex ( GetElementPtrInst GEP)
static

◆ isCallPromotable()

static bool isCallPromotable ( CallInst CI)
static

Definition at line 464 of file AMDGPUPromoteAlloca.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::alignTo(), llvm::CallingConv::AMDGPU_KERNEL, llvm::IRBuilder< T, Inserter >::CreateAdd(), llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateInBoundsGEP(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), llvm::IRBuilder< T, Inserter >::CreateMul(), llvm::dbgs(), llvm::dyn_cast(), E, llvm::Instruction::eraseFromParent(), llvm::errs(), F(), GEP, llvm::AMDGPUSubtarget::get(), llvm::ArrayType::get(), llvm::PointerType::get(), llvm::ConstantPointerNull::get(), llvm::UndefValue::get(), llvm::DataLayout::getABITypeAlignment(), llvm::PointerType::getAddressSpace(), llvm::AllocaInst::getAlignment(), llvm::AllocaInst::getAllocatedType(), llvm::Function::getCallingConv(), llvm::Intrinsic::getDeclaration(), llvm::MemIntrinsicBase< Derived >::getDestAlignment(), llvm::AMDGPUSubtarget::getFlatWorkGroupSizes(), llvm::Function::getFunctionType(), llvm::Type::getInt32Ty(), llvm::IntrinsicInst::getIntrinsicID(), llvm::MemIntrinsicBase< Derived >::getLength(), llvm::AMDGPUSubtarget::getLocalMemorySize(), llvm::AMDGPUSubtarget::getMaxLocalMemSizeWithWaveCount(), llvm::AMDGPUSubtarget::getMaxWavesPerEU(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::AMDGPUSubtarget::getOccupancyWithLocalMemSize(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::Type::getPointerElementType(), llvm::MemIntrinsicBase< Derived >::getRawDest(), llvm::MemTransferBase< BaseCL >::getRawSource(), llvm::MemTransferBase< BaseCL >::getSourceAlignment(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::GetUnderlyingObject(), llvm::MemSetBase< BaseCL >::getValue(), llvm::AMDGPUSubtarget::getWavesPerEU(), llvm::GlobalValue::Global, I, llvm::GlobalValue::InternalLinkage, Intr, llvm::Intrinsic::invariant_end, llvm::Intrinsic::invariant_start, llvm::is_contained(), llvm::AllocaInst::isArrayAllocation(), llvm::Type::isPointerTy(), llvm::AllocaInst::isStaticAlloca(), llvm::MemIntrinsic::isVolatile(), llvm::Intrinsic::launder_invariant_group, llvm::Intrinsic::lifetime_end, llvm::Intrinsic::lifetime_start, LLVM_DEBUG, llvm_unreachable, AMDGPUAS::LOCAL_ADDRESS, llvm::Intrinsic::memcpy, llvm::Intrinsic::memmove, llvm::Intrinsic::memset, llvm::Mod, llvm::Value::mutateType(), llvm::GlobalValue::NotThreadLocal, llvm::Intrinsic::objectsize, llvm::FunctionType::params(), llvm::PointerMayBeCaptured(), llvm::Value::print(), llvm::Value::replaceAllUsesWith(), llvm::IRBuilderBase::SetInsertPoint(), llvm::GlobalValue::setUnnamedAddr(), SI, llvm::CallingConv::SPIR_KERNEL, llvm::ARM_MB::ST, llvm::Intrinsic::strip_invariant_group, llvm::SystemZISD::TM, tryPromoteAllocaToVector(), and llvm::Value::users().

◆ tryPromoteAllocaToVector()

static bool tryPromoteAllocaToVector ( AllocaInst Alloca)
static