LLVM  6.0.0svn
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 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 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 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 visitCastInst (CastInst &I)
 
bool visitBinaryOperator (BinaryOperator &I)
 
bool visitCmpInst (CmpInst &I)
 
bool visitTerminatorInst (TerminatorInst &I)
 
bool visitUnaryInstruction (UnaryInstruction &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 2199 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 2256 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 2285 of file SROA.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, assert(), canConvertValue(), convertValue(), llvm::Instruction::copyMetadata(), llvm::copyNonnullMetadata(), llvm::dbgs(), DEBUG, llvm::Value::deleteValue(), 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::DataLayout::getABITypeAlignment(), getAdjustedPtr(), llvm::AllocaInst::getAlignment(), llvm::MemIntrinsic::getAlignment(), llvm::MemIntrinsic::getAlignmentCst(), llvm::AllocaInst::getAllocatedType(), llvm::Constant::getAllOnesValue(), llvm::CallInst::getArgOperand(), llvm::IntegerType::getBitWidth(), getBitWidth(), llvm::Type::getContext(), llvm::Value::getContext(), llvm::Instruction::getDebugLoc(), llvm::SequentialType::getElementType(), llvm::SelectInst::getFalseValue(), llvm::BasicBlock::getFirstInsertionPt(), llvm::Type::getIntegerBitWidth(), llvm::Type::getIntNTy(), llvm::IntrinsicInst::getIntrinsicID(), llvm::MemIntrinsic::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::DataLayout::getPointerSizeInBits(), llvm::Type::getPointerTo(), llvm::DataLayout::getPointerTypeSizeInBits(), llvm::MemIntrinsic::getRawDest(), llvm::MemIntrinsic::getRawDestUse(), llvm::MemTransferInst::getRawSource(), llvm::Type::getScalarType(), llvm::LoadInst::getSyncScopeID(), llvm::StoreInst::getSyncScopeID(), llvm::SelectInst::getTrueValue(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::DataLayout::getTypeSizeInBits(), llvm::DataLayout::getTypeStoreSize(), llvm::DataLayout::getTypeStoreSizeInBits(), llvm::ConstantExpr::getUDiv(), llvm::Use::getUser(), llvm::MemSetInst::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::Type::isPointerTy(), llvm::LoadInst::isSimple(), llvm::StoreInst::isSimple(), llvm::Type::isSingleValueType(), llvm::LoadInst::isVolatile(), llvm::StoreInst::isVolatile(), llvm::MemIntrinsic::isVolatile(), llvm_unreachable, llvm::SPII::Load, llvm::max(), llvm::LLVMContext::MD_mem_parallel_loop_access, llvm::LLVMContext::MD_nonnull, llvm::MinAlign(), N, NDEBUG, llvm::StringRef::npos, llvm::User::op_begin(), llvm::User::op_end(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::pop_back(), llvm::SmallVectorTemplateBase< T, isPodLike >::pop_back(), llvm::sroa::AllocaSlices::printSlice(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::object::replace(), llvm::Value::replaceAllUsesWith(), llvm::StringRef::rfind(), second, llvm::MemIntrinsic::setAlignment(), llvm::LoadInst::setAtomic(), llvm::StoreInst::setAtomic(), llvm::MemIntrinsic::setDest(), llvm::MemIntrinsic::setLength(), llvm::User::setOperand(), llvm::MemTransferInst::setSource(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size, llvm::SPII::Store, llvm::Value::stripInBoundsOffsets(), llvm::StringRef::substr(), std::swap(), llvm::Value::uses(), and llvm::APInt::zextOrTrunc().

Friends And Related Function Documentation

◆ InstVisitor< AllocaSliceRewriter, bool >

friend class InstVisitor< AllocaSliceRewriter, bool >
friend

Definition at line 2202 of file SROA.cpp.


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