LLVM: llvm::SCCPInstVisitor Class Reference (original ) (raw )Helper class for SCCPSolver . More...
Public Member Functions
void
addPredicateInfo (Function &F , DominatorTree &DT, AssumptionCache &AC)
void
removeSSACopies (Function &F )
void
visitCallInst (CallInst &I )
bool
markBlockExecutable (BasicBlock *BB)
const PredicateBase *
getPredicateInfoFor (Instruction *I )
SCCPInstVisitor (const DataLayout &DL , std::function< const TargetLibraryInfo &(Function &)> GetTLI, LLVMContext &Ctx)
void
trackValueOfGlobalVariable (GlobalVariable *GV)
void
addTrackedFunction (Function *F )
void
addToMustPreserveReturnsInFunctions (Function *F )
bool
mustPreserveReturn (Function *F )
void
addArgumentTrackedFunction (Function *F )
bool
isArgumentTrackedFunction (Function *F )
const SmallPtrSetImpl < Function * > &
getArgumentTrackedFunctions () const
void
solve ()
bool
resolvedUndef (Instruction &I )
bool
resolvedUndefsIn (Function &F )
While solving the dataflow for a function, we don't compute a result for operations with an undef operand, to allow undef to be lowered to a constant later.
bool
isBlockExecutable (BasicBlock *BB) const
bool
isEdgeFeasible (BasicBlock *From, BasicBlock *To) const
std::vector< ValueLatticeElement >
getStructLatticeValueFor (Value *V) const
void
removeLatticeValueFor (Value *V)
void
resetLatticeValueFor (CallBase *Call )
Invalidate the Lattice Value of Call and its users after specializing the call.
const ValueLatticeElement &
getLatticeValueFor (Value *V) const
const MapVector < Function *, ValueLatticeElement > &
getTrackedRetVals () const
const DenseMap < GlobalVariable *, ValueLatticeElement > &
getTrackedGlobals () const
const SmallPtrSet < Function *, 16 > &
getMRVFunctionsTracked () const
void
markOverdefined (Value *V)
ValueLatticeElement
getArgAttributeVL (Argument *A )
void
trackValueOfArgument (Argument *A )
bool
isStructLatticeConstant (Function *F , StructType *STy)
Constant *
getConstant (const ValueLatticeElement &LV, Type *Ty) const
Constant *
getConstantOrNull (Value *V) const
void
setLatticeValueForSpecializationArguments (Function *F , const SmallVectorImpl < ArgInfo > &Args)
void
markFunctionUnreachable (Function *F )
void
solveWhileResolvedUndefsIn (Module &M)
void
solveWhileResolvedUndefsIn (SmallVectorImpl < Function * > &WorkList)
void
solveWhileResolvedUndefs ()
Public Member Functions inherited from llvm::InstVisitor< SCCPInstVisitor >
void
visit (Iterator Start, Iterator End)
void
visitModule (Module &M)
void
visitFunction (Function &F )
void
visitBasicBlock (BasicBlock &BB)
void
visitICmpInst (ICmpInst &I )
void
visitFCmpInst (FCmpInst &I )
void
visitAllocaInst (AllocaInst &I )
void
visitLoadInst (LoadInst &I )
void
visitStoreInst (StoreInst &I )
void
visitAtomicCmpXchgInst (AtomicCmpXchgInst &I )
void
visitAtomicRMWInst (AtomicRMWInst &I )
void
visitFenceInst (FenceInst &I )
void
visitGetElementPtrInst (GetElementPtrInst &I )
void
visitPHINode (PHINode &I )
void
visitTruncInst (TruncInst &I )
void
visitZExtInst (ZExtInst &I )
void
visitSExtInst (SExtInst &I )
void
visitFPTruncInst (FPTruncInst &I )
void
visitFPExtInst (FPExtInst &I )
void
visitFPToUIInst (FPToUIInst &I )
void
visitFPToSIInst (FPToSIInst &I )
void
visitUIToFPInst (UIToFPInst &I )
void
visitSIToFPInst (SIToFPInst &I )
void
visitPtrToIntInst (PtrToIntInst &I )
void
visitPtrToAddrInst (PtrToAddrInst &I )
void
visitIntToPtrInst (IntToPtrInst &I )
void
visitBitCastInst (BitCastInst &I )
void
visitAddrSpaceCastInst (AddrSpaceCastInst &I )
void
visitSelectInst (SelectInst &I )
void
visitVAArgInst (VAArgInst &I )
void
visitExtractElementInst (ExtractElementInst &I )
void
visitInsertElementInst (InsertElementInst &I )
void
visitShuffleVectorInst (ShuffleVectorInst &I )
void
visitExtractValueInst (ExtractValueInst &I )
void
visitInsertValueInst (InsertValueInst &I )
void
visitLandingPadInst (LandingPadInst &I )
void
visitFuncletPadInst (FuncletPadInst &I )
void
visitCleanupPadInst (CleanupPadInst &I )
void
visitCatchPadInst (CatchPadInst &I )
void
visitFreezeInst (FreezeInst &I )
void
visitMemSetInst (MemSetInst &I )
void
visitMemSetPatternInst (MemSetPatternInst &I )
void
visitMemCpyInst (MemCpyInst &I )
void
visitMemMoveInst (MemMoveInst &I )
void
visitMemTransferInst (MemTransferInst &I )
void
visitMemIntrinsic (MemIntrinsic &I )
void
visitVAStartInst (VAStartInst &I )
void
visitVAEndInst (VAEndInst &I )
void
visitVACopyInst (VACopyInst &I )
void
visitIntrinsicInst (IntrinsicInst &I )
void
visitCallInst (CallInst &I )
void
visitInvokeInst (InvokeInst &I )
void
visitCallBrInst (CallBrInst &I )
void
visitReturnInst (ReturnInst &I )
void
visitBranchInst (BranchInst &I )
void
visitSwitchInst (SwitchInst &I )
void
visitIndirectBrInst (IndirectBrInst &I )
void
visitResumeInst (ResumeInst &I )
void
visitUnreachableInst (UnreachableInst &I )
void
visitCleanupReturnInst (CleanupReturnInst &I )
void
visitCatchReturnInst (CatchReturnInst &I )
void
visitCatchSwitchInst (CatchSwitchInst &I )
void
visitTerminator (Instruction &I )
void
visitCastInst (CastInst &I )
void
visitUnaryOperator (UnaryOperator &I )
void
visitBinaryOperator (BinaryOperator &I )
void
visitCmpInst (CmpInst &I )
void
visitUnaryInstruction (UnaryInstruction &I )
void
visitCallBase (CallBase &I )
void
visitInstruction (Instruction &I )
Helper class for SCCPSolver .
This implements the instruction visitor and holds all the state.
Definition at line 520 of file SCCPSolver.cpp .
◆ addArgumentTrackedFunction()
void llvm::SCCPInstVisitor::addArgumentTrackedFunction ( Function * F )
inline
◆ addPredicateInfo()◆ addToMustPreserveReturnsInFunctions()
void llvm::SCCPInstVisitor::addToMustPreserveReturnsInFunctions ( Function * F )
inline
◆ addTrackedFunction()
void llvm::SCCPInstVisitor::addTrackedFunction ( Function * F )
inline
◆ getArgAttributeVL()◆ getArgumentTrackedFunctions()◆ getConstant()◆ getConstantOrNull()Definition at line 1147 of file SCCPSolver.cpp .
References llvm::any_of() , assert() , llvm::cast() , llvm::ConstantStruct::get() , llvm::UndefValue::get() , getConstant() , getLatticeValueFor() , getStructLatticeValueFor() , I , llvm::SCCPSolver::isConstant() , and llvm::SCCPSolver::isOverdefined() .
◆ getLatticeValueFor()◆ getMRVFunctionsTracked()◆ getPredicateInfoFor()◆ getStructLatticeValueFor()◆ getTrackedGlobals()◆ getTrackedRetVals()◆ isArgumentTrackedFunction()
bool llvm::SCCPInstVisitor::isArgumentTrackedFunction ( Function * F )
inline
◆ isBlockExecutable()
bool llvm::SCCPInstVisitor::isBlockExecutable ( BasicBlock * BB ) const
inline
◆ isEdgeFeasible()◆ isStructLatticeConstant()◆ markBlockExecutable()◆ markFunctionUnreachable()
void llvm::SCCPInstVisitor::markFunctionUnreachable ( Function * F )
inline
◆ markOverdefined()
void llvm::SCCPInstVisitor::markOverdefined ( Value * V )
inline
◆ mustPreserveReturn()
bool llvm::SCCPInstVisitor::mustPreserveReturn ( Function * F )
inline
◆ removeLatticeValueFor()
void llvm::SCCPInstVisitor::removeLatticeValueFor ( Value * V )
inline
◆ removeSSACopies()
void llvm::SCCPInstVisitor::removeSSACopies ( Function & F )
inline
◆ resetLatticeValueFor()
void llvm::SCCPInstVisitor::resetLatticeValueFor ( CallBase * Call )
inline
Invalidate the Lattice Value of Call and its users after specializing the call.
Then recompute it.
Definition at line 928 of file SCCPSolver.cpp .
References assert() , Call , and F .
◆ resolvedUndef()◆ resolvedUndefsIn()While solving the dataflow for a function, we don't compute a result for operations with an undef operand, to allow undef to be lowered to a constant later.
For example, constant folding of "zext i8 undef to i16" would result in "i16 0", and if undef is later lowered to "i8 1", then the zext result would become "i16 1" and would result into an overdefined lattice value once merged with the previous result. Not computing the result of the zext (treating undef the same as unknown) allows us to handle a later undef->constant lowering more optimally.
However, if the operand remains undef when the solver returns, we do need to assign some result to the instruction (otherwise we would treat it as unreachable). For simplicity, we mark any instructions that are still unknown as overdefined.
Definition at line 2292 of file SCCPSolver.cpp .
References llvm::dbgs() , F , I , LLVM_DEBUG , and resolvedUndef() .
Referenced by solveWhileResolvedUndefsIn() , and solveWhileResolvedUndefsIn() .
◆ setLatticeValueForSpecializationArguments()◆ solve()
void SCCPInstVisitor::solve
(
)
◆ solveWhileResolvedUndefs()
void llvm::SCCPInstVisitor::solveWhileResolvedUndefs ( )
inline
◆ solveWhileResolvedUndefsIn() [1/2]
void llvm::SCCPInstVisitor::solveWhileResolvedUndefsIn ( Module & M )
inline
◆ solveWhileResolvedUndefsIn() [2/2]◆ trackValueOfArgument()
void llvm::SCCPInstVisitor::trackValueOfArgument ( Argument * A )
inline
◆ trackValueOfGlobalVariable()
void llvm::SCCPInstVisitor::trackValueOfGlobalVariable ( GlobalVariable * GV )
inline
◆ visitCallInst()
void llvm::SCCPInstVisitor::visitCallInst ( CallInst & I )
inline
◆ InstVisitor< SCCPInstVisitor >
The documentation for this class was generated from the following file: