LLVM  8.0.1
Public Member Functions | Friends | List of all members
llvm::sroa::AllocaSliceRewriter Class Reference

Visitor to rewrite instructions using p particular slice of an alloca to use a new alloca. More...

Inheritance diagram for llvm::sroa::AllocaSliceRewriter:
Inheritance graph
[legend]
Collaboration diagram for llvm::sroa::AllocaSliceRewriter:
Collaboration graph
[legend]

Public Member Functions

 AllocaSliceRewriter (const DataLayout &DL, AllocaSlices &AS, SROA &Pass, AllocaInst &OldAI, AllocaInst &NewAI, uint64_t NewAllocaBeginOffset, uint64_t NewAllocaEndOffset, bool IsIntegerPromotable, VectorType *PromotableVecTy, SmallSetVector< PHINode *, 8 > &PHIUsers, SmallSetVector< SelectInst *, 8 > &SelectUsers)
 
bool visit (AllocaSlices::const_iterator I)
 
- Public Member Functions inherited from llvm::InstVisitor< AllocaSliceRewriter, bool >
void visit (Iterator Start, Iterator End)
 
void visit (Module &M)
 
void visit (Function &F)
 
void visit (BasicBlock &BB)
 
void visit (Module *M)
 
void visit (Function *F)
 
void visit (BasicBlock *BB)
 
bool visit (Instruction *I)
 
bool visit (Instruction &I)
 
void visitModule (Module &M)
 
void visitFunction (Function &F)
 
void visitBasicBlock (BasicBlock &BB)
 
bool visitICmpInst (ICmpInst &I)
 
bool visitFCmpInst (FCmpInst &I)
 
bool visitAllocaInst (AllocaInst &I)
 
bool visitLoadInst (LoadInst &I)
 
bool visitStoreInst (StoreInst &I)
 
bool visitAtomicCmpXchgInst (AtomicCmpXchgInst &I)
 
bool visitAtomicRMWInst (AtomicRMWInst &I)
 
bool visitFenceInst (FenceInst &I)
 
bool visitGetElementPtrInst (GetElementPtrInst &I)
 
bool visitPHINode (PHINode &I)
 
bool visitTruncInst (TruncInst &I)
 
bool visitZExtInst (ZExtInst &I)
 
bool visitSExtInst (SExtInst &I)
 
bool visitFPTruncInst (FPTruncInst &I)
 
bool visitFPExtInst (FPExtInst &I)
 
bool visitFPToUIInst (FPToUIInst &I)
 
bool visitFPToSIInst (FPToSIInst &I)
 
bool visitUIToFPInst (UIToFPInst &I)
 
bool visitSIToFPInst (SIToFPInst &I)
 
bool visitPtrToIntInst (PtrToIntInst &I)
 
bool visitIntToPtrInst (IntToPtrInst &I)
 
bool visitBitCastInst (BitCastInst &I)
 
bool visitAddrSpaceCastInst (AddrSpaceCastInst &I)
 
bool visitSelectInst (SelectInst &I)
 
bool visitVAArgInst (VAArgInst &I)
 
bool visitExtractElementInst (ExtractElementInst &I)
 
bool visitInsertElementInst (InsertElementInst &I)
 
bool visitShuffleVectorInst (ShuffleVectorInst &I)
 
bool visitExtractValueInst (ExtractValueInst &I)
 
bool visitInsertValueInst (InsertValueInst &I)
 
bool visitLandingPadInst (LandingPadInst &I)
 
bool visitFuncletPadInst (FuncletPadInst &I)
 
bool visitCleanupPadInst (CleanupPadInst &I)
 
bool visitCatchPadInst (CatchPadInst &I)
 
bool visitDbgDeclareInst (DbgDeclareInst &I)
 
bool visitDbgValueInst (DbgValueInst &I)
 
bool visitDbgVariableIntrinsic (DbgVariableIntrinsic &I)
 
bool visitDbgLabelInst (DbgLabelInst &I)
 
bool visitDbgInfoIntrinsic (DbgInfoIntrinsic &I)
 
bool visitMemSetInst (MemSetInst &I)
 
bool visitMemCpyInst (MemCpyInst &I)
 
bool visitMemMoveInst (MemMoveInst &I)
 
bool visitMemTransferInst (MemTransferInst &I)
 
bool visitMemIntrinsic (MemIntrinsic &I)
 
bool visitVAStartInst (VAStartInst &I)
 
bool visitVAEndInst (VAEndInst &I)
 
bool visitVACopyInst (VACopyInst &I)
 
bool visitIntrinsicInst (IntrinsicInst &I)
 
bool visitCallInst (CallInst &I)
 
bool visitInvokeInst (InvokeInst &I)
 
bool visitReturnInst (ReturnInst &I)
 
bool visitBranchInst (BranchInst &I)
 
bool visitSwitchInst (SwitchInst &I)
 
bool visitIndirectBrInst (IndirectBrInst &I)
 
bool visitResumeInst (ResumeInst &I)
 
bool visitUnreachableInst (UnreachableInst &I)
 
bool visitCleanupReturnInst (CleanupReturnInst &I)
 
bool visitCatchReturnInst (CatchReturnInst &I)
 
bool visitCatchSwitchInst (CatchSwitchInst &I)
 
bool visitTerminator (Instruction &I)
 
bool visitCastInst (CastInst &I)
 
bool visitUnaryOperator (UnaryOperator &I)
 
bool visitBinaryOperator (BinaryOperator &I)
 
bool visitCmpInst (CmpInst &I)
 
bool visitUnaryInstruction (UnaryInstruction &I)
 
bool visitCallBase (CallBase &I)
 
bool visitCallSite (CallSite CS)
 
void visitInstruction (Instruction &I)
 

Friends

class InstVisitor< AllocaSliceRewriter, bool >
 

Detailed Description

Visitor to rewrite instructions using p particular slice of an alloca to use a new alloca.

Also implements the rewriting to vector-based accesses when the partition passes the isVectorPromotionViable predicate. Most of the rewriting logic lives here.

Definition at line 2220 of file SROA.cpp.

Constructor & Destructor Documentation

◆ AllocaSliceRewriter()

llvm::sroa::AllocaSliceRewriter::AllocaSliceRewriter ( const DataLayout DL,
AllocaSlices AS,
SROA Pass,
AllocaInst OldAI,
AllocaInst NewAI,
uint64_t  NewAllocaBeginOffset,
uint64_t  NewAllocaEndOffset,
bool  IsIntegerPromotable,
VectorType PromotableVecTy,
SmallSetVector< PHINode *, 8 > &  PHIUsers,
SmallSetVector< SelectInst *, 8 > &  SelectUsers 
)
inline

Definition at line 2277 of file SROA.cpp.

References assert(), and llvm::DataLayout::getTypeSizeInBits().

Member Function Documentation

◆ visit()

bool llvm::sroa::AllocaSliceRewriter::visit ( AllocaSlices::const_iterator  I)
inline

Definition at line 2306 of file SROA.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, assert(), canConvertValue(), convertValue(), llvm::Instruction::copyMetadata(), llvm::copyNonnullMetadata(), llvm::dbgs(), llvm::Value::deleteValue(), llvm::SmallVectorBase::empty(), llvm::Instruction::eraseFromParent(), extractInteger(), extractVector(), llvm::StringRef::find(), llvm::StringRef::find_first_not_of(), GEP, llvm::ConstantInt::get(), llvm::VectorType::get(), llvm::UndefValue::get(), llvm::Instruction::getAAMetadata(), llvm::DataLayout::getABITypeAlignment(), getAdjustedAlignment(), getAdjustedPtr(), llvm::AllocaInst::getAlignment(), llvm::LoadInst::getAlignment(), llvm::StoreInst::getAlignment(), llvm::AllocaInst::getAllocatedType(), llvm::Constant::getAllOnesValue(), llvm::CallBase::getArgOperand(), llvm::IntegerType::getBitWidth(), getBitWidth(), llvm::Type::getContext(), llvm::Value::getContext(), llvm::Instruction::getDebugLoc(), llvm::MemIntrinsicBase< Derived >::getDestAlignment(), llvm::SequentialType::getElementType(), llvm::SelectInst::getFalseValue(), llvm::BasicBlock::getFirstInsertionPt(), llvm::DataLayout::getIndexedOffsetInType(), llvm::DataLayout::getIndexSizeInBits(), llvm::DataLayout::getIndexTypeSizeInBits(), llvm::Type::getInt8PtrTy(), llvm::Type::getIntegerBitWidth(), llvm::Type::getIntNTy(), llvm::IntrinsicInst::getIntrinsicID(), llvm::MemIntrinsicBase< Derived >::getLength(), llvm::Instruction::getMetadata(), llvm::Value::getName(), llvm::User::getOperand(), llvm::LoadInst::getOrdering(), llvm::StoreInst::getOrdering(), llvm::Instruction::getParent(), llvm::LoadInst::getPointerAddressSpace(), llvm::Type::getPointerAddressSpace(), llvm::StoreInst::getPointerAddressSpace(), llvm::LoadInst::getPointerOperand(), llvm::StoreInst::getPointerOperand(), llvm::Type::getPointerTo(), llvm::MemIntrinsicBase< Derived >::getRawDest(), llvm::MemIntrinsicBase< Derived >::getRawDestUse(), llvm::MemTransferBase< BaseCL >::getRawSource(), llvm::Type::getScalarType(), llvm::MemTransferBase< BaseCL >::getSourceAlignment(), llvm::LoadInst::getSyncScopeID(), llvm::StoreInst::getSyncScopeID(), llvm::SelectInst::getTrueValue(), llvm::Value::getType(), llvm::DataLayout::getTypeSizeInBits(), llvm::DataLayout::getTypeStoreSize(), llvm::DataLayout::getTypeStoreSizeInBits(), llvm::ConstantExpr::getUDiv(), llvm::Use::getUser(), llvm::MemSetBase< BaseCL >::getValue(), llvm::StoreInst::getValueOperand(), llvm::ConstantExpr::getZExt(), llvm::APInt::getZExtValue(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), insertInteger(), insertVector(), llvm::DataLayout::isBigEndian(), llvm::isInstructionTriviallyDead(), llvm::Type::isIntegerTy(), llvm::DataLayout::isLegalInteger(), llvm::Instruction::isLifetimeStartOrEnd(), llvm::Type::isPointerTy(), llvm::LoadInst::isSimple(), llvm::StoreInst::isSimple(), llvm::Type::isSingleValueType(), llvm::LoadInst::isVolatile(), llvm::StoreInst::isVolatile(), llvm::MemIntrinsic::isVolatile(), llvm::Intrinsic::lifetime_start, LLVM_DEBUG, llvm_unreachable, llvm::SPII::Load, llvm::max(), llvm::LLVMContext::MD_access_group, llvm::LLVMContext::MD_mem_parallel_loop_access, llvm::LLVMContext::MD_nonnull, llvm::MinAlign(), N, Name, NDEBUG, llvm::StringRef::npos, llvm::User::op_begin(), llvm::User::op_end(), llvm::SmallVectorTemplateBase< T >::pop_back(), llvm::SmallVectorTemplateBase< T, bool >::pop_back(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::sroa::AllocaSlices::printSlice(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorTemplateBase< T >::push_back(), replace(), llvm::Value::replaceAllUsesWith(), llvm::StringRef::rfind(), second, llvm::Instruction::setAAMetadata(), llvm::LoadInst::setAlignment(), llvm::StoreInst::setAlignment(), llvm::LoadInst::setAtomic(), llvm::StoreInst::setAtomic(), llvm::MemIntrinsicBase< Derived >::setDest(), llvm::MemIntrinsicBase< Derived >::setDestAlignment(), llvm::MemIntrinsicBase< Derived >::setLength(), llvm::User::setOperand(), llvm::MemTransferBase< BaseCL >::setSource(), llvm::MemTransferBase< BaseCL >::setSourceAlignment(), Size, llvm::SmallVectorBase::size(), llvm::SPII::Store, llvm::Value::stripInBoundsOffsets(), llvm::StringRef::substr(), std::swap(), llvm::Value::users(), llvm::Value::uses(), and llvm::APInt::zextOrTrunc().

Friends And Related Function Documentation

◆ InstVisitor< AllocaSliceRewriter, bool >

friend class InstVisitor< AllocaSliceRewriter, bool >
friend

Definition at line 2223 of file SROA.cpp.


The documentation for this class was generated from the following file: