LLVM API Documentation
#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/Support/Debug.h"
Go to the source code of this file.
Defines | |
#define | DEBUG_TYPE "amdgpu-promote-alloca" |
Functions | |
static VectorType * | arrayTypeToVecType (const Type *ArrayTy) |
static Value * | calculateVectorIndex (Value *Ptr, std::map< GetElementPtrInst *, Value * > GEPIdx) |
static Value * | GEPToVectorIndex (GetElementPtrInst *GEP) |
static bool | canVectorizeInst (Instruction *Inst) |
static bool | tryPromoteAllocaToVector (AllocaInst *Alloca) |
static void | collectUsesWithPtrTypes (Value *Val, std::vector< Value * > &WorkList) |
#define DEBUG_TYPE "amdgpu-promote-alloca" |
Definition at line 22 of file AMDGPUPromoteAlloca.cpp.
static VectorType* arrayTypeToVecType | ( | const Type * | ArrayTy | ) | [static] |
Definition at line 103 of file AMDGPUPromoteAlloca.cpp.
References llvm::VectorType::get(), llvm::Type::getArrayElementType(), and llvm::Type::getArrayNumElements().
Referenced by tryPromoteAllocaToVector().
static Value* calculateVectorIndex | ( | Value * | Ptr, |
std::map< GetElementPtrInst *, Value * > | GEPIdx | ||
) | [static] |
Definition at line 108 of file AMDGPUPromoteAlloca.cpp.
References llvm::Value::getContext(), llvm::Type::getInt32Ty(), and llvm::Constant::getNullValue().
Referenced by tryPromoteAllocaToVector().
static bool canVectorizeInst | ( | Instruction * | Inst | ) | [static] |
Definition at line 134 of file AMDGPUPromoteAlloca.cpp.
References llvm::AddrSpaceCast, llvm::Instruction::getOpcode(), llvm::SPII::Load, and llvm::SPII::Store.
Referenced by tryPromoteAllocaToVector().
static void collectUsesWithPtrTypes | ( | Value * | Val, |
std::vector< Value * > & | WorkList | ||
) | [static] |
Definition at line 235 of file AMDGPUPromoteAlloca.cpp.
References llvm::Value::getType(), llvm::Type::isPointerTy(), and llvm::Value::users().
static Value* GEPToVectorIndex | ( | GetElementPtrInst * | GEP | ) | [static] |
Definition at line 118 of file AMDGPUPromoteAlloca.cpp.
References llvm::dyn_cast(), llvm::User::getNumOperands(), llvm::User::getOperand(), and llvm::ConstantInt::isZero().
Referenced by tryPromoteAllocaToVector().
static bool tryPromoteAllocaToVector | ( | AllocaInst * | Alloca | ) | [static] |
Definition at line 146 of file AMDGPUPromoteAlloca.cpp.
References llvm::AddrSpaceCast, arrayTypeToVecType(), calculateVectorIndex(), canVectorizeInst(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateBitCast(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateExtractElement(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateInsertElement(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateLoad(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateStore(), llvm::dbgs(), DEBUG, llvm::Value::dump(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), ExtractElement(), GEPToVectorIndex(), llvm::AllocaInst::getAllocatedType(), llvm::Type::getArrayElementType(), llvm::Type::getArrayNumElements(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Type::getPointerTo(), I, llvm::Type::isArrayTy(), llvm::Type::isVectorTy(), llvm_unreachable, llvm::SPII::Load, llvm::Value::replaceAllUsesWith(), llvm::SPII::Store, and llvm::Value::users().