LLVM  6.0.0svn
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, AMDGPUAS AS)
 
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 294 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 433 of file AMDGPUPromoteAlloca.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::alignTo(), llvm::CallingConv::AMDGPU_KERNEL, AS, 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(), DEBUG, llvm::dyn_cast(), E, llvm::Instruction::eraseFromParent(), llvm::errs(), F(), GEP, llvm::ArrayType::get(), llvm::PointerType::get(), llvm::ConstantPointerNull::get(), llvm::UndefValue::get(), llvm::DataLayout::getABITypeAlignment(), llvm::PointerType::getAddressSpace(), llvm::AllocaInst::getAlignment(), llvm::MemIntrinsic::getAlignment(), llvm::AllocaInst::getAllocatedType(), llvm::Function::getCallingConv(), llvm::Intrinsic::getDeclaration(), llvm::AMDGPUSubtarget::getFlatWorkGroupSizes(), llvm::Function::getFunctionType(), llvm::Type::getInt32Ty(), llvm::IntrinsicInst::getIntrinsicID(), llvm::MemIntrinsic::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::MemIntrinsic::getRawDest(), llvm::MemTransferInst::getRawSource(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::GetUnderlyingObject(), llvm::MemSetInst::getValue(), llvm::AMDGPUSubtarget::getWavesPerEU(), llvm::GlobalValue::Global, I, llvm::GlobalValue::InternalLinkage, llvm::is_contained(), llvm::AllocaInst::isArrayAllocation(), llvm::Type::isPointerTy(), llvm::AllocaInst::isStaticAlloca(), llvm::MemIntrinsic::isVolatile(), llvm_unreachable, AMDGPUAS::LOCAL_ADDRESS, llvm::Value::mutateType(), llvm::GlobalValue::NotThreadLocal, 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::SystemZISD::TM, tryPromoteAllocaToVector(), and llvm::Value::users().

◆ tryPromoteAllocaToVector()

static bool tryPromoteAllocaToVector ( AllocaInst Alloca,
AMDGPUAS  AS 
)
static