LLVM
8.0.1
|
#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>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "amdgpu-promote-alloca" |
Functions | |
static VectorType * | arrayTypeToVecType (ArrayType *ArrayTy) |
static Value * | calculateVectorIndex (Value *Ptr, const std::map< GetElementPtrInst *, Value *> &GEPIdx) |
static Value * | GEPToVectorIndex (GetElementPtrInst *GEP) |
static bool | canVectorizeInst (Instruction *Inst, User *User) |
static bool | tryPromoteAllocaToVector (AllocaInst *Alloca) |
static bool | isCallPromotable (CallInst *CI) |
#define DEBUG_TYPE "amdgpu-promote-alloca" |
Definition at line 62 of file AMDGPUPromoteAlloca.cpp.
|
static |
Definition at line 295 of file AMDGPUPromoteAlloca.cpp.
References llvm::VectorType::get(), llvm::SequentialType::getElementType(), and llvm::SequentialType::getNumElements().
Referenced by tryPromoteAllocaToVector().
|
static |
Definition at line 301 of file AMDGPUPromoteAlloca.cpp.
Referenced by tryPromoteAllocaToVector().
|
static |
Definition at line 325 of file AMDGPUPromoteAlloca.cpp.
References llvm::Instruction::getOpcode(), llvm::LoadInst::getPointerOperand(), llvm::StoreInst::getPointerOperand(), llvm::LoadInst::getPointerOperandType(), llvm::StoreInst::getPointerOperandType(), llvm::Value::getType(), llvm::StoreInst::getValueOperand(), llvm::LoadInst::isSimple(), llvm::StoreInst::isSimple(), llvm::SPII::Load, SI, and llvm::SPII::Store.
Referenced by tryPromoteAllocaToVector().
|
static |
Definition at line 309 of file AMDGPUPromoteAlloca.cpp.
References llvm::dyn_cast(), llvm::User::getNumOperands(), llvm::User::getOperand(), and llvm::ConstantInt::isZero().
Referenced by tryPromoteAllocaToVector().
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().
|
static |
Definition at line 355 of file AMDGPUPromoteAlloca.cpp.
References arrayTypeToVecType(), calculateVectorIndex(), canVectorizeInst(), llvm::dbgs(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), GEP, GEPToVectorIndex(), llvm::AllocaInst::getAllocatedType(), llvm::SequentialType::getElementType(), llvm::SequentialType::getNumElements(), llvm::Instruction::getOpcode(), llvm::StoreInst::getPointerOperand(), llvm::getPointerOperand(), llvm::Type::getPointerTo(), llvm::Value::getType(), llvm::StoreInst::getValueOperand(), llvm::VectorType::isValidElementType(), LLVM_DEBUG, llvm_unreachable, llvm::SPII::Load, AMDGPUAS::PRIVATE_ADDRESS, llvm::Value::replaceAllUsesWith(), SI, llvm::SPII::Store, and llvm::Value::users().
Referenced by isCallPromotable().