LLVM: lib/Transforms/Scalar/RewriteStatepointsForGC.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "rewrite-statepoints-for-gc"
Functions
static void stripNonValidData (Module &M)
The IR fed into RewriteStatepointsForGC may have had attributes and metadata implying dereferenceability that are no longer valid/correct after RewriteStatepointsForGC has run.
static std::unique_ptr< GCStrategy > findGCStrategy (Function &F)
Looks up the GC strategy for a given function, returning null if the function doesn't have a GC tag.
static bool shouldRewriteStatepointsIn (Function &F)
Returns true if this function should be rewritten by this pass.
static ArrayRef< Use > GetDeoptBundleOperands (const CallBase *Call)
static void computeLiveInValues (DominatorTree &DT, Function &F, GCPtrLivenessData &Data, GCStrategy *GC)
Compute the live-in set for every basic block in the function.
static void findLiveSetAtInst (Instruction *inst, GCPtrLivenessData &Data, StatepointLiveSetTy &out, GCStrategy *GC)
Given results from the dataflow liveness computation, find the set of live Values at a particular instruction.
static bool isGCPointerType (Type *T, GCStrategy *GC)
static bool isHandledGCPointerType (Type *T, GCStrategy *GC)
static bool containsGCPtrType (Type *Ty, GCStrategy *GC)
Returns true if this type contains a gc pointer whether we know how to handle that type or not.
static bool isUnhandledGCPointerType (Type *Ty, GCStrategy *GC)
static std::string suffixed_name_or (Value *V, StringRef Suffix, StringRef DefaultName)
static void analyzeParsePointLiveness (DominatorTree &DT, GCPtrLivenessData &OriginalLivenessData, CallBase *Call, PartiallyConstructedSafepointRecord &Result, GCStrategy *GC)
static bool isKnownBase (Value *V, const IsKnownBaseMapTy &KnownBases)
Returns true if V is a known base.
static void setKnownBase (Value *V, bool IsKnownBase, IsKnownBaseMapTy &KnownBases)
Caches the IsKnownBase flag for a value and asserts that it wasn't present in the cache before.
static Value * findBaseDefiningValue (Value *I, DefiningValueMapTy &Cache, IsKnownBaseMapTy &KnownBases)
Helper function for findBasePointer - Will return a value which either a) defines the base pointer for the input, b) blocks the simple search (i.e.
static Value * findBaseDefiningValueOfVector (Value *I, DefiningValueMapTy &Cache, IsKnownBaseMapTy &KnownBases)
Return a base defining value for the 'Index' element of the given vector instruction 'I'.
static Value * findBaseDefiningValueCached (Value *I, DefiningValueMapTy &Cache, IsKnownBaseMapTy &KnownBases)
Returns the base defining value for this value.
static Value * findBaseOrBDV (Value *I, DefiningValueMapTy &Cache, IsKnownBaseMapTy &KnownBases)
Return a base pointer for this value if known.
static bool isOriginalBaseResult (Value *V)
This value is a base pointer that is not generated by RS4GC, i.e.
static bool areBothVectorOrScalar (Value *First, Value *Second)
static raw_ostream & operator<< (raw_ostream &OS, const BDVState &State)
static Value * findBasePointer (Value *I, DefiningValueMapTy &Cache, IsKnownBaseMapTy &KnownBases)
For a given value or instruction, figure out what base ptr its derived from.
static void findBasePointers (const StatepointLiveSetTy &live, PointerToBaseTy &PointerToBase, DominatorTree *DT, DefiningValueMapTy &DVCache, IsKnownBaseMapTy &KnownBases)
static void findBasePointers (DominatorTree &DT, DefiningValueMapTy &DVCache, CallBase *Call, PartiallyConstructedSafepointRecord &result, PointerToBaseTy &PointerToBase, IsKnownBaseMapTy &KnownBases)
Find the required based pointers (and adjust the live set) for the given parse point.
static void recomputeLiveInValues (GCPtrLivenessData &RevisedLivenessData, CallBase *Call, PartiallyConstructedSafepointRecord &result, PointerToBaseTy &PointerToBase, GCStrategy *GC)
Given an updated version of the dataflow liveness results, update the liveset and base pointer maps for the call site CS.
static void recomputeLiveInValues (Function &F, DominatorTree &DT, ArrayRef< CallBase * > toUpdate, MutableArrayRef< struct PartiallyConstructedSafepointRecord > records, PointerToBaseTy &PointerToBase, GCStrategy *GC)
static Instruction * rematerializeChain (ArrayRef< Instruction * > ChainToBase, BasicBlock::iterator InsertBefore, Value *RootOfChain, Value *AlternateLiveBase)
static BasicBlock * normalizeForInvokeSafepoint (BasicBlock *BB, BasicBlock *InvokeParent, DominatorTree &DT)
static AttributeList legalizeCallAttributes (CallBase *Call, bool IsMemIntrinsic, AttributeList StatepointAL)
static void CreateGCRelocates (ArrayRef< Value * > LiveVariables, ArrayRef< Value * > BasePtrs, Instruction *StatepointToken, IRBuilder<> &Builder, GCStrategy *GC)
Helper function to place all gc relocates necessary for the given statepoint.
static StringRef getDeoptLowering (CallBase *Call)
static void makeStatepointExplicitImpl (CallBase *Call, const SmallVectorImpl< Value * > &BasePtrs, const SmallVectorImpl< Value * > &LiveVariables, PartiallyConstructedSafepointRecord &Result, std::vector< DeferredReplacement > &Replacements, const PointerToBaseTy &PointerToBase, GCStrategy *GC)
static void makeStatepointExplicit (DominatorTree &DT, CallBase *Call, PartiallyConstructedSafepointRecord &Result, std::vector< DeferredReplacement > &Replacements, const PointerToBaseTy &PointerToBase, GCStrategy *GC)
static void insertRelocationStores (iterator_range< Value::user_iterator > GCRelocs, DenseMap< Value *, AllocaInst * > &AllocaMap, DenseSet< Value * > &VisitedLiveValues)
static void insertRematerializationStores (const RematerializedValueMapTy &RematerializedValues, DenseMap< Value *, AllocaInst * > &AllocaMap, DenseSet< Value * > &VisitedLiveValues)
static void relocationViaAlloca (Function &F, DominatorTree &DT, ArrayRef< Value * > Live, ArrayRef< PartiallyConstructedSafepointRecord > Records)
Do all the relocation update via allocas and mem2reg.
static void insertUseHolderAfter (CallBase *Call, const ArrayRef< Value * > Values, SmallVectorImpl< CallInst * > &Holders)
Insert holders so that each Value is obviously live through the entire lifetime of the call.
static void findLiveReferences (Function &F, DominatorTree &DT, ArrayRef< CallBase * > toUpdate, MutableArrayRef< struct PartiallyConstructedSafepointRecord > records, GCStrategy *GC)
static Value * findRematerializableChainToBasePointer (SmallVectorImpl< Instruction * > &ChainToBase, Value *CurrentValue)
static InstructionCost chainToBasePointerCost (SmallVectorImpl< Instruction * > &Chain, TargetTransformInfo &TTI)
static bool AreEquivalentPhiNodes (PHINode &OrigRootPhi, PHINode &AlternateRootPhi)
static void findRematerializationCandidates (PointerToBaseTy PointerToBase, RematCandTy &RematerizationCandidates, TargetTransformInfo &TTI)
static void rematerializeLiveValuesAtUses (RematCandTy &RematerizationCandidates, MutableArrayRef< PartiallyConstructedSafepointRecord > Records, PointerToBaseTy &PointerToBase)
static void rematerializeLiveValues (CallBase *Call, PartiallyConstructedSafepointRecord &Info, PointerToBaseTy &PointerToBase, RematCandTy &RematerizationCandidates, TargetTransformInfo &TTI)
static bool inlineGetBaseAndOffset (Function &F, SmallVectorImpl< CallInst * > &Intrinsics, DefiningValueMapTy &DVCache, IsKnownBaseMapTy &KnownBases)
static bool insertParsePoints (Function &F, DominatorTree &DT, TargetTransformInfo &TTI, SmallVectorImpl< CallBase * > &ToUpdate, DefiningValueMapTy &DVCache, IsKnownBaseMapTy &KnownBases)
static AttributeMask getParamAndReturnAttributesToRemove ()
static void stripNonValidAttributesFromPrototype (Function &F)
static void stripInvalidMetadataFromInstruction (Instruction &I)
Certain metadata on instructions are invalid after running RS4GC.
static void stripNonValidDataFromBody (Function &F)
static void computeLiveInValues (BasicBlock::reverse_iterator Begin, BasicBlock::reverse_iterator End, SetVector< Value * > &LiveTmp, GCStrategy *GC)
Compute the live-in set for the location rbegin starting from the live-out set of the basic block.
static void computeLiveOutSeed (BasicBlock *BB, SetVector< Value * > &LiveTmp, GCStrategy *GC)
static SetVector< Value * > computeKillSet (BasicBlock *BB, GCStrategy *GC)
static void checkBasicSSA (DominatorTree &DT, SetVector< Value * > &Live, Instruction *TI, bool TermOkay=false)
Check that the items in 'Live' dominate 'TI'.
static void checkBasicSSA (DominatorTree &DT, GCPtrLivenessData &Data, BasicBlock &BB)
Check that all the liveness sets used during the computation of liveness obey basic SSA properties.
Variables
static cl::opt< bool > PrintLiveSet ("spp-print-liveset", cl::Hidden, cl::init(false))
static cl::opt< bool > PrintLiveSetSize ("spp-print-liveset-size", cl::Hidden, cl::init(false))
static cl::opt< bool > PrintBasePointers ("spp-print-base-pointers", cl::Hidden, cl::init(false))
static cl::opt< unsigned > RematerializationThreshold ("spp-rematerialization-threshold", cl::Hidden, cl::init(6))
static bool ClobberNonLive = false
static cl::opt< bool, true > ClobberNonLiveOverride ("rs4gc-clobber-non-live", cl::location(ClobberNonLive), cl::Hidden)
static cl::opt< bool > AllowStatepointWithNoDeoptInfo ("rs4gc-allow-statepoint-with-no-deopt-info", cl::Hidden, cl::init(true))
static cl::opt< bool > RematDerivedAtUses ("rs4gc-remat-derived-at-uses", cl::Hidden, cl::init(true))
static constexpr Attribute::AttrKind FnAttrsToStrip []

DEBUG_TYPE

#define DEBUG_TYPE "rewrite-statepoints-for-gc"

analyzeParsePointLiveness()

void analyzeParsePointLiveness ( DominatorTree & DT, GCPtrLivenessData & OriginalLivenessData, CallBase * Call, PartiallyConstructedSafepointRecord & Result, GCStrategy * GC ) static

areBothVectorOrScalar()

AreEquivalentPhiNodes()

Definition at line 2321 of file RewriteStatepointsForGC.cpp.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::PHINode::getNumIncomingValues(), and llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent().

Referenced by findRematerializationCandidates().

chainToBasePointerCost()

checkBasicSSA() [1/2]

checkBasicSSA() [2/2]

computeKillSet()

computeLiveInValues() [1/2]

Compute the live-in set for the location rbegin starting from the live-out set of the basic block.

Definition at line 3190 of file RewriteStatepointsForGC.cpp.

References assert(), I, llvm::SetVector< T, Vector, Set, N >::insert(), llvm::isa(), isHandledGCPointerType(), isUnhandledGCPointerType(), llvm::make_range(), and llvm::SetVector< T, Vector, Set, N >::remove().

computeLiveInValues() [2/2]

Compute the live-in set for every basic block in the function.

Definition at line 3277 of file RewriteStatepointsForGC.cpp.

References assert(), checkBasicSSA(), computeKillSet(), computeLiveInValues(), computeLiveOutSeed(), llvm::Data, llvm::SetVector< T, Vector, Set, N >::empty(), F, llvm::SetVector< T, Vector, Set, N >::insert_range(), llvm::SetVector< T, Vector, Set, N >::pop_back_val(), llvm::predecessors(), llvm::SetVector< T, Vector, Set, N >::set_subtract(), llvm::SetVector< T, Vector, Set, N >::set_union(), llvm::SetVector< T, Vector, Set, N >::size(), and llvm::successors().

Referenced by computeLiveInValues(), findLiveReferences(), findLiveSetAtInst(), and recomputeLiveInValues().

computeLiveOutSeed()

Definition at line 3223 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::dyn_cast(), llvm::PHINode::getIncomingValueForBlock(), I, llvm::SetVector< T, Vector, Set, N >::insert(), llvm::isa(), isHandledGCPointerType(), isUnhandledGCPointerType(), and llvm::successors().

Referenced by computeLiveInValues().

containsGCPtrType()

CreateGCRelocates()

Helper function to place all gc relocates necessary for the given statepoint.

Inputs: liveVariables - list of variables to be relocated. basePtrs - base pointers. statepointToken - statepoint instruction to which relocates should be bound. Builder - Llvm IR builder to be used to construct new calls.

Definition at line 1502 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::ArrayRef< T >::begin(), llvm::cast(), llvm::CallingConv::Cold, llvm::dyn_cast(), llvm::ArrayRef< T >::end(), llvm::find(), llvm::FixedVectorType::get(), llvm::PointerType::get(), llvm::Instruction::getModule(), getNumElements(), llvm::Intrinsic::getOrInsertDeclaration(), isHandledGCPointerType(), llvm::ArrayRef< T >::size(), suffixed_name_or(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().

Referenced by makeStatepointExplicitImpl().

findBaseDefiningValue()

Value * findBaseDefiningValue ( Value * I, DefiningValueMapTy & Cache, IsKnownBaseMapTy & KnownBases ) static

Helper function for findBasePointer - Will return a value which either a) defines the base pointer for the input, b) blocks the simple search (i.e.

a PHI or Select of two derived pointers), or c) involves a change from pointer to vector type or back.

Definition at line 449 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::cast(), llvm::dyn_cast(), findBaseDefiningValue(), findBaseDefiningValueOfVector(), GEP, llvm::ConstantPointerNull::get(), I, II, llvm::isa(), llvm_unreachable, setKnownBase(), and llvm::AtomicRMWInst::Xchg.

Referenced by findBaseDefiningValue(), findBaseDefiningValueCached(), and findBaseDefiningValueOfVector().

findBaseDefiningValueCached()

Value * findBaseDefiningValueCached ( Value * I, DefiningValueMapTy & Cache, IsKnownBaseMapTy & KnownBases ) static

findBaseDefiningValueOfVector()

Value * findBaseDefiningValueOfVector ( Value * I, DefiningValueMapTy & Cache, IsKnownBaseMapTy & KnownBases ) static

Return a base defining value for the 'Index' element of the given vector instruction 'I'.

If Index is null, returns a BDV for the entire vector 'I'. As an optimization, this method will try to determine when the element is known to already be a base pointer. If this can be established, the second value in the returned pair will be true. Note that either a vector or a pointer typed value can be returned. For the former, the vector returned is a BDV (and possibly a base) of the entire vector 'I'. If the later, the return pointer is a BDV (or possibly a base) for the particular element in 'I'.

Definition at line 351 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::dyn_cast(), findBaseDefiningValue(), GEP, llvm::ConstantAggregateZero::get(), I, llvm::isa(), and setKnownBase().

Referenced by findBaseDefiningValue().

findBaseOrBDV()

Value * findBaseOrBDV ( Value * I, DefiningValueMapTy & Cache, IsKnownBaseMapTy & KnownBases ) static

findBasePointer()

Value * findBasePointer ( Value * I, DefiningValueMapTy & Cache, IsKnownBaseMapTy & KnownBases ) static

For a given value or instruction, figure out what base ptr its derived from.

For gc objects, this is simply itself. On success, returns a value which is the base pointer. (This is reliable and can be used for relocation.) On failure, returns nullptr.

Definition at line 811 of file RewriteStatepointsForGC.cpp.

References areBothVectorOrScalar(), assert(), llvm::sampleprof::Base, llvm::cast(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::count(), llvm::dbgs(), DL, llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end(), F, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::find(), findBaseOrBDV(), llvm::MDNode::get(), llvm::PoisonValue::get(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::Value::getName(), llvm::PHINode::getNumIncomingValues(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), I, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::insert(), llvm::Instruction::insertBefore(), llvm::isa(), isKnownBase(), isOriginalBaseResult(), LLVM_DEBUG, llvm_unreachable, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), setKnownBase(), llvm::Instruction::setMetadata(), llvm::Value::setName(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::size(), suffixed_name_or(), ToRemove, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().

Referenced by findBasePointers(), and inlineGetBaseAndOffset().

findBasePointers() [1/2]

void findBasePointers ( const StatepointLiveSetTy & live, PointerToBaseTy & PointerToBase, DominatorTree * DT, DefiningValueMapTy & DVCache, IsKnownBaseMapTy & KnownBases ) static

findBasePointers() [2/2]

void findBasePointers ( DominatorTree & DT, DefiningValueMapTy & DVCache, CallBase * Call, PartiallyConstructedSafepointRecord & result, PointerToBaseTy & PointerToBase, IsKnownBaseMapTy & KnownBases ) static

findGCStrategy()

findLiveReferences()

findLiveSetAtInst()

void findLiveSetAtInst ( Instruction * inst, GCPtrLivenessData & Data, StatepointLiveSetTy & out, GCStrategy * GC ) static

Given results from the dataflow liveness computation, find the set of live Values at a particular instruction.

Definition at line 3344 of file RewriteStatepointsForGC.cpp.

References assert(), computeLiveInValues(), llvm::Data, llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::BasicBlock::rbegin(), and llvm::SetVector< T, Vector, Set, N >::remove().

Referenced by analyzeParsePointLiveness(), and recomputeLiveInValues().

findRematerializableChainToBasePointer()

findRematerializationCandidates()

void findRematerializationCandidates ( PointerToBaseTy PointerToBase, RematCandTy & RematerizationCandidates, TargetTransformInfo & TTI ) static

GetDeoptBundleOperands()

getDeoptLowering()

getParamAndReturnAttributesToRemove()

inlineGetBaseAndOffset()

Definition at line 2598 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::sampleprof::Base, Changed, DL, F, findBasePointer(), llvm::Type::getIntNTy(), llvm::Type::getPointerAddressSpace(), llvm::Value::getType(), llvm_unreachable, llvm::Offset, and suffixed_name_or().

Referenced by llvm::RewriteStatepointsForGC::runOnFunction().

insertParsePoints()

Global mapping from live pointers to a base-defining-value.

Definition at line 2646 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), Call, llvm::cast(), llvm::SmallVectorImpl< T >::clear(), llvm::DominatorTree::dominates(), llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::errs(), F, findBasePointers(), findGCStrategy(), findLiveReferences(), findRematerializationCandidates(), llvm::SetVector< T, Vector, Set, N >::getArrayRef(), GetDeoptBundleOperands(), II, Info, info, llvm::SetVector< T, Vector, Set, N >::insert_range(), insertUseHolderAfter(), llvm::isa(), isHandledGCPointerType(), llvm::DominatorTree::isReachableFromEntry(), isUnhandledGCPointerType(), makeStatepointExplicit(), normalizeForInvokeSafepoint(), PrintBasePointers, llvm::SmallVectorTemplateBase< T, bool >::push_back(), recomputeLiveInValues(), relocationViaAlloca(), rematerializeLiveValues(), rematerializeLiveValuesAtUses(), llvm::SmallVectorImpl< T >::reserve(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by llvm::RewriteStatepointsForGC::runOnFunction().

insertRelocationStores()

Definition at line 1970 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::dyn_cast(), llvm::GCRelocateInst::getDerivedPtr(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), and llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert().

Referenced by relocationViaAlloca().

insertRematerializationStores()

insertUseHolderAfter()

isGCPointerType()

isHandledGCPointerType()

isKnownBase()

isOriginalBaseResult()

bool isOriginalBaseResult ( Value * V) static

isUnhandledGCPointerType()

legalizeCallAttributes()

AttributeList legalizeCallAttributes ( CallBase * Call, bool IsMemIntrinsic, AttributeList StatepointAL ) static

makeStatepointExplicit()

void makeStatepointExplicit ( DominatorTree & DT, CallBase * Call, PartiallyConstructedSafepointRecord & Result, std::vector< DeferredReplacement > & Replacements, const PointerToBaseTy & PointerToBase, GCStrategy * GC ) static

makeStatepointExplicitImpl()

Definition at line 1647 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::sampleprof::Base, llvm::BasicBlock::begin(), Call, llvm::cast(), llvm::SmallVectorImpl< T >::clear(), CreateGCRelocates(), llvm::StatepointDirectives::DefaultStatepointID, llvm::DeoptLiveIn, DL, llvm::dyn_cast(), F, llvm::GCTransition, llvm::ConstantPointerNull::get(), llvm::FunctionType::get(), llvm::CallBase::getAttributes(), llvm::FunctionCallee::getCallee(), llvm::Value::getContext(), getDeoptLowering(), llvm::BasicBlock::getFirstInsertionPt(), llvm::Type::getIntNTy(), llvm::BasicBlock::getLandingPadInst(), llvm::BasicBlock::getUniquePredecessor(), llvm::Type::getVoidTy(), II, llvm::isa(), legalizeCallAttributes(), llvm_unreachable, llvm::None, llvm::StatepointDirectives::NumPatchBytes, llvm::LLVMContext::OB_deopt, llvm::LLVMContext::OB_gc_transition, llvm::parseStatepointDirectivesFromAttrs(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::CallBase::setAttributes(), llvm::CallBase::setCallingConv(), llvm::Value::setName(), llvm::CallInst::setTailCallKind(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::StatepointDirectives::StatepointID.

Referenced by makeStatepointExplicit().

normalizeForInvokeSafepoint()

operator<<()

recomputeLiveInValues() [1/2]

recomputeLiveInValues() [2/2]

void recomputeLiveInValues ( GCPtrLivenessData & RevisedLivenessData, CallBase * Call, PartiallyConstructedSafepointRecord & result, PointerToBaseTy & PointerToBase, GCStrategy * GC ) static

relocationViaAlloca()

Do all the relocation update via allocas and mem2reg.

Definition at line 2017 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::cast(), ClobberNonLive, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::count(), DL, llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), F, llvm::ConstantAggregateZero::get(), llvm::ConstantPointerNull::get(), llvm::AllocaInst::getAllocatedType(), llvm::BasicBlock::getFirstNonPHIIt(), I, II, Info, insertRelocationStores(), insertRematerializationStores(), llvm::isa(), llvm::Last, llvm::PromoteMemToReg(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::ArrayRef< T >::size(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::sort(), llvm::unique(), llvm::Value::users(), and Uses.

Referenced by insertParsePoints().

rematerializeChain()

rematerializeLiveValues()

void rematerializeLiveValues ( CallBase * Call, PartiallyConstructedSafepointRecord & Info, PointerToBaseTy & PointerToBase, RematCandTy & RematerizationCandidates, TargetTransformInfo & TTI ) static

rematerializeLiveValuesAtUses()

void rematerializeLiveValuesAtUses ( RematCandTy & RematerizationCandidates, MutableArrayRef< PartiallyConstructedSafepointRecord > Records, PointerToBaseTy & PointerToBase ) static

Definition at line 2411 of file RewriteStatepointsForGC.cpp.

References llvm::any_of(), assert(), llvm::cast(), llvm::count_if(), llvm::dbgs(), llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), findRematerializableChainToBasePointer(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Value::getNumUses(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::Value::getUniqueUndroppableUser(), llvm::Value::hasOneUse(), LLVM_DEBUG, P, llvm::SmallVectorTemplateBase< T, bool >::push_back(), RematDerivedAtUses, RematerializationThreshold, rematerializeChain(), llvm::User::replaceUsesOfWith(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::Value::user_begin(), llvm::Value::user_empty(), and llvm::Value::users().

Referenced by insertParsePoints().

setKnownBase()

void setKnownBase ( Value * V, bool IsKnownBase, IsKnownBaseMapTy & KnownBases ) static

shouldRewriteStatepointsIn()

stripInvalidMetadataFromInstruction()

void stripInvalidMetadataFromInstruction ( Instruction & I) static

stripNonValidAttributesFromPrototype()

void stripNonValidAttributesFromPrototype ( Function & F) static

stripNonValidData()

void stripNonValidData ( Module & M) static

stripNonValidDataFromBody()

void stripNonValidDataFromBody ( Function & F) static

Definition at line 2946 of file RewriteStatepointsForGC.cpp.

References Call, llvm::dyn_cast(), F, llvm::PoisonValue::get(), getParamAndReturnAttributesToRemove(), I, II, instructions, llvm::isa(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and stripInvalidMetadataFromInstruction().

Referenced by stripNonValidData().

suffixed_name_or()

AllowStatepointWithNoDeoptInfo

cl::opt< bool > AllowStatepointWithNoDeoptInfo("rs4gc-allow-statepoint-with-no-deopt-info", cl::Hidden, cl::init(true)) ( "rs4gc-allow-statepoint-with-no-deopt-info" , cl::Hidden , cl::init(true) ) static

ClobberNonLive

bool ClobberNonLive = false static

ClobberNonLiveOverride

cl::opt< bool, true > ClobberNonLiveOverride("rs4gc-clobber-non-live", cl::location(ClobberNonLive), cl::Hidden) ( "rs4gc-clobber-non-live" , cl::location(ClobberNonLive) , cl::Hidden ) static

FnAttrsToStrip

Attribute::AttrKind FnAttrsToStrip[] staticconstexpr

PrintBasePointers

cl::opt< bool > PrintBasePointers("spp-print-base-pointers", cl::Hidden, cl::init(false)) ( "spp-print-base-pointers" , cl::Hidden , cl::init(false) ) static

PrintLiveSet

cl::opt< bool > PrintLiveSet("spp-print-liveset", cl::Hidden, cl::init(false)) ( "spp-print-liveset" , cl::Hidden , cl::init(false) ) static

PrintLiveSetSize

cl::opt< bool > PrintLiveSetSize("spp-print-liveset-size", cl::Hidden, cl::init(false)) ( "spp-print-liveset-size" , cl::Hidden , cl::init(false) ) static

RematDerivedAtUses

cl::opt< bool > RematDerivedAtUses("rs4gc-remat-derived-at-uses", cl::Hidden, cl::init(true)) ( "rs4gc-remat-derived-at-uses" , cl::Hidden , cl::init(true) ) static

RematerializationThreshold

cl::opt< unsigned > RematerializationThreshold("spp-rematerialization-threshold", cl::Hidden, cl::init(6)) ( "spp-rematerialization-threshold" , cl::Hidden , cl::init(6) ) static