LLVM  4.0.0
Classes | Namespaces | Macros | Typedefs | Functions | Variables
RewriteStatepointsForGC.cpp File Reference
#include "llvm/Pass.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/Statepoint.h"
#include "llvm/IR/Value.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
Include dependency graph for RewriteStatepointsForGC.cpp:

Go to the source code of this file.

Classes

struct  false::GCPtrLivenessData
 
struct  false::PartiallyConstructedSafepointRecord
 

Namespaces

 false
 

Macros

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

Typedefs

typedef MapVector< Value
*, Value * > 
false::DefiningValueMapTy
 
typedef SetVector< Value * > false::StatepointLiveSetTy
 
typedef MapVector< AssertingVH
< Instruction >, AssertingVH
< Value > > 
false::RematerializedValueMapTy
 

Functions

 INITIALIZE_PASS_BEGIN (RewriteStatepointsForGC,"rewrite-statepoints-for-gc","Make relocations explicit at statepoints", false, false) INITIALIZE_PASS_END(RewriteStatepointsForGC
 
static ArrayRef< UseGetDeoptBundleOperands (ImmutableCallSite CS)
 
static void computeLiveInValues (DominatorTree &DT, Function &F, GCPtrLivenessData &Data)
 Compute the live-in set for every basic block in the function. More...
 
static void findLiveSetAtInst (Instruction *inst, GCPtrLivenessData &Data, StatepointLiveSetTy &out)
 Given results from the dataflow liveness computation, find the set of live Values at a particular instruction. More...
 
static bool isGCPointerType (Type *T)
 
static bool isHandledGCPointerType (Type *T)
 
static bool containsGCPtrType (Type *Ty)
 Returns true if this type contains a gc pointer whether we know how to handle that type or not. More...
 
static bool isUnhandledGCPointerType (Type *Ty)
 
static std::string suffixed_name_or (Value *V, StringRef Suffix, StringRef DefaultName)
 
static void analyzeParsePointLiveness (DominatorTree &DT, GCPtrLivenessData &OriginalLivenessData, CallSite CS, PartiallyConstructedSafepointRecord &Result)
 
static bool isKnownBaseResult (Value *V)
 Given the result of a call to findBaseDefiningValue, or findBaseOrBDV, is it known to be a base pointer? Or do we need to continue searching. More...
 
static BaseDefiningValueResult findBaseDefiningValue (Value *I)
 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. More...
 
static BaseDefiningValueResult findBaseDefiningValueOfVector (Value *I)
 Return a base defining value for the 'Index' element of the given vector instruction 'I'. More...
 
static ValuefindBaseDefiningValueCached (Value *I, DefiningValueMapTy &Cache)
 Returns the base defining value for this value. More...
 
static ValuefindBaseOrBDV (Value *I, DefiningValueMapTy &Cache)
 Return a base pointer for this value if known. More...
 
static raw_ostreamoperator<< (raw_ostream &OS, const BDVState &State)
 
static BDVState meetBDVStateImpl (const BDVState &LHS, const BDVState &RHS)
 
static BDVState meetBDVState (BDVState LHS, BDVState RHS)
 
static ValuefindBasePointer (Value *I, DefiningValueMapTy &Cache)
 For a given value or instruction, figure out what base ptr its derived from. More...
 
static void findBasePointers (const StatepointLiveSetTy &live, MapVector< Value *, Value * > &PointerToBase, DominatorTree *DT, DefiningValueMapTy &DVCache)
 
static void findBasePointers (DominatorTree &DT, DefiningValueMapTy &DVCache, CallSite CS, PartiallyConstructedSafepointRecord &result)
 Find the required based pointers (and adjust the live set) for the given parse point. More...
 
static void recomputeLiveInValues (GCPtrLivenessData &RevisedLivenessData, CallSite CS, PartiallyConstructedSafepointRecord &result)
 Given an updated version of the dataflow liveness results, update the liveset and base pointer maps for the call site CS. More...
 
static void recomputeLiveInValues (Function &F, DominatorTree &DT, ArrayRef< CallSite > toUpdate, MutableArrayRef< struct PartiallyConstructedSafepointRecord > records)
 
static BasicBlocknormalizeForInvokeSafepoint (BasicBlock *BB, BasicBlock *InvokeParent, DominatorTree &DT)
 
static AttributeSet legalizeCallAttributes (AttributeSet AS)
 
static void CreateGCRelocates (ArrayRef< Value * > LiveVariables, const int LiveStart, ArrayRef< Value * > BasePtrs, Instruction *StatepointToken, IRBuilder<> Builder)
 Helper function to place all gc relocates necessary for the given statepoint. More...
 
static StringRef getDeoptLowering (CallSite CS)
 
static void makeStatepointExplicitImpl (const CallSite CS, const SmallVectorImpl< Value * > &BasePtrs, const SmallVectorImpl< Value * > &LiveVariables, PartiallyConstructedSafepointRecord &Result, std::vector< DeferredReplacement > &Replacements)
 
static void makeStatepointExplicit (DominatorTree &DT, CallSite CS, PartiallyConstructedSafepointRecord &Result, std::vector< DeferredReplacement > &Replacements)
 
static void insertRelocationStores (iterator_range< Value::user_iterator > GCRelocs, DenseMap< Value *, Value * > &AllocaMap, DenseSet< Value * > &VisitedLiveValues)
 
static void insertRematerializationStores (const RematerializedValueMapTy &RematerializedValues, DenseMap< Value *, Value * > &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. More...
 
template<typename T >
static void unique_unsorted (SmallVectorImpl< T > &Vec)
 Implement a unique function which doesn't require we sort the input vector. More...
 
static void insertUseHolderAfter (CallSite &CS, const ArrayRef< Value * > Values, SmallVectorImpl< CallInst * > &Holders)
 Insert holders so that each Value is obviously live through the entire lifetime of the call. More...
 
static void findLiveReferences (Function &F, DominatorTree &DT, ArrayRef< CallSite > toUpdate, MutableArrayRef< struct PartiallyConstructedSafepointRecord > records)
 
static ValuefindRematerializableChainToBasePointer (SmallVectorImpl< Instruction * > &ChainToBase, Value *CurrentValue)
 
static unsigned chainToBasePointerCost (SmallVectorImpl< Instruction * > &Chain, TargetTransformInfo &TTI)
 
static bool AreEquivalentPhiNodes (PHINode &OrigRootPhi, PHINode &AlternateRootPhi)
 
static void rematerializeLiveValues (CallSite CS, PartiallyConstructedSafepointRecord &Info, TargetTransformInfo &TTI)
 
static bool insertParsePoints (Function &F, DominatorTree &DT, TargetTransformInfo &TTI, SmallVectorImpl< CallSite > &ToUpdate)
 
template<typename AttrHolder >
static void RemoveNonValidAttrAtIndex (LLVMContext &Ctx, AttrHolder &AH, unsigned Index)
 
static bool shouldRewriteStatepointsIn (Function &F)
 Returns true if this function should be rewritten by this pass. More...
 
static void computeLiveInValues (BasicBlock::reverse_iterator Begin, BasicBlock::reverse_iterator End, SetVector< Value * > &LiveTmp)
 Compute the live-in set for the location rbegin starting from the live-out set of the basic block. More...
 
static void computeLiveOutSeed (BasicBlock *BB, SetVector< Value * > &LiveTmp)
 
static SetVector< Value * > computeKillSet (BasicBlock *BB)
 
static void checkBasicSSA (DominatorTree &DT, SetVector< Value * > &Live, TerminatorInst *TI, bool TermOkay=false)
 Check that the items in 'Live' dominate 'TI'. More...
 
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. More...
 

Variables

static cl::opt< boolPrintLiveSet ("spp-print-liveset", cl::Hidden, cl::init(false))
 
static cl::opt< boolPrintLiveSetSize ("spp-print-liveset-size", cl::Hidden, cl::init(false))
 
static cl::opt< boolPrintBasePointers ("spp-print-base-pointers", cl::Hidden, cl::init(false))
 
static cl::opt< unsignedRematerializationThreshold ("spp-rematerialization-threshold", cl::Hidden, cl::init(6))
 
static bool ClobberNonLive = false
 
static cl::opt< bool, trueClobberNonLiveOverride ("rs4gc-clobber-non-live", cl::location(ClobberNonLive), cl::Hidden)
 
static cl::opt< boolAllowStatepointWithNoDeoptInfo ("rs4gc-allow-statepoint-with-no-deopt-info", cl::Hidden, cl::init(true))
 
rewrite statepoints for gc
 
rewrite statepoints for Make
relocations at 
statepoints
 
rewrite statepoints for Make
relocations at 
false
 

Macro Definition Documentation

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

Definition at line 46 of file RewriteStatepointsForGC.cpp.

Function Documentation

static void analyzeParsePointLiveness ( DominatorTree DT,
GCPtrLivenessData &  OriginalLivenessData,
CallSite  CS,
PartiallyConstructedSafepointRecord &  Result 
)
static
static bool AreEquivalentPhiNodes ( PHINode OrigRootPhi,
PHINode AlternateRootPhi 
)
static
static unsigned chainToBasePointerCost ( SmallVectorImpl< Instruction * > &  Chain,
TargetTransformInfo TTI 
)
static
static void checkBasicSSA ( DominatorTree DT,
SetVector< Value * > &  Live,
TerminatorInst TI,
bool  TermOkay = false 
)
static

Check that the items in 'Live' dominate 'TI'.

This is used as a basic sanity check for the liveness computation.

Definition at line 2546 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::DominatorTree::dominates(), and I.

Referenced by checkBasicSSA(), and computeLiveInValues().

static void checkBasicSSA ( DominatorTree DT,
GCPtrLivenessData &  Data,
BasicBlock BB 
)
static

Check that all the liveness sets used during the computation of liveness obey basic SSA properties.

This is useful for finding cases where we miss a def.

Definition at line 2564 of file RewriteStatepointsForGC.cpp.

References checkBasicSSA(), and llvm::BasicBlock::getTerminator().

static SetVector<Value *> computeKillSet ( BasicBlock BB)
static
static void computeLiveInValues ( DominatorTree DT,
Function F,
GCPtrLivenessData &  Data 
)
static
static void computeLiveInValues ( BasicBlock::reverse_iterator  Begin,
BasicBlock::reverse_iterator  End,
SetVector< Value * > &  LiveTmp 
)
static

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

Definition at line 2486 of file RewriteStatepointsForGC.cpp.

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

static void computeLiveOutSeed ( BasicBlock BB,
SetVector< Value * > &  LiveTmp 
)
static
static bool containsGCPtrType ( Type Ty)
static

Returns true if this type contains a gc pointer whether we know how to handle that type or not.

Definition at line 245 of file RewriteStatepointsForGC.cpp.

References llvm::any_of(), isGCPointerType(), and llvm::ARM_MB::ST.

Referenced by isUnhandledGCPointerType().

static void CreateGCRelocates ( ArrayRef< Value * >  LiveVariables,
const int  LiveStart,
ArrayRef< Value * >  BasePtrs,
Instruction StatepointToken,
IRBuilder<>  Builder 
)
static

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

Inputs: liveVariables - list of variables to be relocated. liveStart - index of the first live variable. 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 1170 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::ArrayRef< T >::begin(), llvm::CallingConv::Cold, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::end(), llvm::find(), llvm::VectorType::get(), llvm::Module::getContext(), llvm::Intrinsic::getDeclaration(), llvm::IRBuilderBase::getInt32(), llvm::Type::getInt8PtrTy(), llvm::Instruction::getModule(), i, isHandledGCPointerType(), llvm::CallInst::setCallingConv(), llvm::ArrayRef< T >::size(), and suffixed_name_or().

Referenced by makeStatepointExplicitImpl().

static BaseDefiningValueResult findBaseDefiningValue ( Value I)
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 379 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::tgtok::Def, findBaseDefiningValueOfVector(), GEP, llvm::ConstantPointerNull::get(), llvm::Value::getType(), llvm::Type::isPtrOrPtrVectorTy(), llvm::Type::isVectorTy(), and llvm_unreachable.

Referenced by findBaseDefiningValueCached().

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

Returns the base defining value for this value.

Definition at line 500 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::dbgs(), DEBUG, findBaseDefiningValue(), llvm::Value::getName(), and I.

Referenced by findBaseOrBDV().

static BaseDefiningValueResult findBaseDefiningValueOfVector ( Value I)
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 337 of file RewriteStatepointsForGC.cpp.

References assert(), llvm::ConstantAggregateZero::get(), and llvm::Value::getType().

Referenced by findBaseDefiningValue().

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

Return a base pointer for this value if known.

Otherwise, return it's base defining value.

Definition at line 513 of file RewriteStatepointsForGC.cpp.

References llvm::tgtok::Def, and findBaseDefiningValueCached().

Referenced by findBasePointer().

static Value* findBasePointer ( Value I,
DefiningValueMapTy &  Cache 
)
static
static void findBasePointers ( const StatepointLiveSetTy &  live,
MapVector< Value *, Value * > &  PointerToBase,
DominatorTree DT,
DefiningValueMapTy &  DVCache 
)
static
static void findBasePointers ( DominatorTree DT,
DefiningValueMapTy &  DVCache,
CallSite  CS,
PartiallyConstructedSafepointRecord &  result 
)
static

Find the required based pointers (and adjust the live set) for the given parse point.

Definition at line 1061 of file RewriteStatepointsForGC.cpp.

References llvm::errs(), findBasePointers(), and PrintBasePointers.

static void findLiveReferences ( Function F,
DominatorTree DT,
ArrayRef< CallSite toUpdate,
MutableArrayRef< struct PartiallyConstructedSafepointRecord >  records 
)
static
static void findLiveSetAtInst ( Instruction inst,
GCPtrLivenessData &  Data,
StatepointLiveSetTy &  out 
)
static

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

Definition at line 2639 of file RewriteStatepointsForGC.cpp.

References assert(), computeLiveInValues(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Instruction::getParent(), llvm::ilist_iterator< OptionsT, IsReverse, IsConst >::getReverse(), and llvm::BasicBlock::rbegin().

Referenced by analyzeParsePointLiveness(), and recomputeLiveInValues().

static Value* findRematerializableChainToBasePointer ( SmallVectorImpl< Instruction * > &  ChainToBase,
Value CurrentValue 
)
static
static ArrayRef<Use> GetDeoptBundleOperands ( ImmutableCallSite  CS)
static
static StringRef getDeoptLowering ( CallSite  CS)
static
INITIALIZE_PASS_BEGIN ( RewriteStatepointsForGC  ,
"rewrite-statepoints-for-gc ,
"Make relocations explicit at statepoints ,
false  ,
false   
)
static bool insertParsePoints ( Function F,
DominatorTree DT,
TargetTransformInfo TTI,
SmallVectorImpl< CallSite > &  ToUpdate 
)
static
static void insertRelocationStores ( iterator_range< Value::user_iterator GCRelocs,
DenseMap< Value *, Value * > &  AllocaMap,
DenseSet< Value * > &  VisitedLiveValues 
)
static
static void insertRematerializationStores ( const RematerializedValueMapTy &  RematerializedValues,
DenseMap< Value *, Value * > &  AllocaMap,
DenseSet< Value * > &  VisitedLiveValues 
)
static
static void insertUseHolderAfter ( CallSite CS,
const ArrayRef< Value * >  Values,
SmallVectorImpl< CallInst * > &  Holders 
)
static
static bool isGCPointerType ( Type T)
static

Definition at line 217 of file RewriteStatepointsForGC.cpp.

Referenced by containsGCPtrType(), and isHandledGCPointerType().

static bool isHandledGCPointerType ( Type T)
static
static bool isKnownBaseResult ( Value V)
static

Given the result of a call to findBaseDefiningValue, or findBaseOrBDV, is it known to be a base pointer? Or do we need to continue searching.

Definition at line 526 of file RewriteStatepointsForGC.cpp.

Referenced by findBasePointer().

static bool isUnhandledGCPointerType ( Type Ty)
static
static AttributeSet legalizeCallAttributes ( AttributeSet  AS)
static
static void makeStatepointExplicit ( DominatorTree DT,
CallSite  CS,
PartiallyConstructedSafepointRecord &  Result,
std::vector< DeferredReplacement > &  Replacements 
)
static
static void makeStatepointExplicitImpl ( const CallSite  CS,
const SmallVectorImpl< Value * > &  BasePtrs,
const SmallVectorImpl< Value * > &  LiveVariables,
PartiallyConstructedSafepointRecord &  Result,
std::vector< DeferredReplacement > &  Replacements 
)
static

Definition at line 1317 of file RewriteStatepointsForGC.cpp.

References llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), assert(), llvm::BasicBlock::begin(), llvm::Call, CreateGCRelocates(), llvm::IRBuilderBase::CreateGCResult(), llvm::IRBuilderBase::CreateGCStatepointCall(), llvm::IRBuilderBase::CreateGCStatepointInvoke(), llvm::StatepointDirectives::DefaultStatepointID, llvm::DeoptLiveIn, llvm::StringRef::equals(), F, fuzzer::Flags, llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::gcArgsStartIdx(), llvm::GCTransition, llvm::FunctionType::get(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getAttributes(), llvm::CallInst::getAttributes(), llvm::InvokeInst::getAttributes(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledValue(), llvm::CallInst::getCallingConv(), llvm::InvokeInst::getCallingConv(), llvm::Instruction::getDebugLoc(), GetDeoptBundleOperands(), getDeoptLowering(), llvm::BasicBlock::getFirstInsertionPt(), llvm::AttributeSet::getFnAttributes(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::BasicBlock::getLandingPadInst(), llvm::Value::getName(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::InvokeInst::getNormalDest(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getOperandBundle(), llvm::AttributeSet::getRetAttributes(), llvm::CallInst::getTailCallKind(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getType(), llvm::BasicBlock::getUniquePredecessor(), llvm::InvokeInst::getUnwindDest(), llvm::Type::getVoidTy(), llvm::Value::hasName(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::isCall(), llvm::Type::isVoidTy(), legalizeCallAttributes(), llvm::None, llvm::StatepointDirectives::NumPatchBytes, llvm::LLVMContext::OB_gc_transition, llvm::parseStatepointDirectivesFromAttrs(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::CallInst::setAttributes(), llvm::InvokeInst::setCallingConv(), llvm::IRBuilderBase::SetCurrentDebugLocation(), llvm::IRBuilderBase::SetInsertPoint(), llvm::Value::setName(), llvm::CallInst::setTailCallKind(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::StatepointDirectives::StatepointID, Token, and llvm::Value::use_empty().

Referenced by makeStatepointExplicit().

static BDVState meetBDVState ( BDVState  LHS,
BDVState  RHS 
)
static

Definition at line 637 of file RewriteStatepointsForGC.cpp.

References assert(), and meetBDVStateImpl().

Referenced by findBasePointer().

static BDVState meetBDVStateImpl ( const BDVState &  LHS,
const BDVState &  RHS 
)
static

Definition at line 609 of file RewriteStatepointsForGC.cpp.

References assert(), llvm_unreachable, and llvm::Unknown.

Referenced by meetBDVState().

static BasicBlock* normalizeForInvokeSafepoint ( BasicBlock BB,
BasicBlock InvokeParent,
DominatorTree DT 
)
static
static raw_ostream& operator<< ( raw_ostream OS,
const BDVState &  State 
)
static

Definition at line 603 of file RewriteStatepointsForGC.cpp.

static void recomputeLiveInValues ( GCPtrLivenessData &  RevisedLivenessData,
CallSite  CS,
PartiallyConstructedSafepointRecord &  result 
)
static

Given an updated version of the dataflow liveness results, update the liveset and base pointer maps for the call site CS.

Definition at line 2658 of file RewriteStatepointsForGC.cpp.

References findLiveSetAtInst(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), and llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert().

Referenced by insertParsePoints(), and recomputeLiveInValues().

static void recomputeLiveInValues ( Function F,
DominatorTree DT,
ArrayRef< CallSite toUpdate,
MutableArrayRef< struct PartiallyConstructedSafepointRecord >  records 
)
static
static void relocationViaAlloca ( Function F,
DominatorTree DT,
ArrayRef< Value * >  Live,
ArrayRef< PartiallyConstructedSafepointRecord >  Records 
)
static
static void rematerializeLiveValues ( CallSite  CS,
PartiallyConstructedSafepointRecord &  Info,
TargetTransformInfo TTI 
)
static
template<typename AttrHolder >
static void RemoveNonValidAttrAtIndex ( LLVMContext Ctx,
AttrHolder &  AH,
unsigned  Index 
)
static
static bool shouldRewriteStatepointsIn ( Function F)
static

Returns true if this function should be rewritten by this pass.

The main point of this function is as an extension point for custom logic.

Definition at line 2361 of file RewriteStatepointsForGC.cpp.

References llvm::Function::getGC(), and llvm::Function::hasGC().

static std::string suffixed_name_or ( Value V,
StringRef  Suffix,
StringRef  DefaultName 
)
static
template<typename T >
static void unique_unsorted ( SmallVectorImpl< T > &  Vec)
static

Implement a unique function which doesn't require we sort the input vector.

Doing so has the effect of changing the output of a couple of tests in ways which make them less useful in testing fused safepoints.

Definition at line 1789 of file RewriteStatepointsForGC.cpp.

References llvm::SmallVectorTemplateCommon< T >::end(), llvm::SmallVectorImpl< T >::erase(), llvm::SmallSet< T, N, C >::insert(), and llvm::remove_if().

Referenced by insertParsePoints().

Variable Documentation

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

Referenced by GetDeoptBundleOperands().

bool ClobberNonLive = false
static

Definition at line 68 of file RewriteStatepointsForGC.cpp.

Referenced by relocationViaAlloca().

cl::opt<bool, true> ClobberNonLiveOverride("rs4gc-clobber-non-live", cl::location(ClobberNonLive), cl::Hidden)
static
rewrite statepoints for Make relocations at false
explicit

Definition at line 135 of file RewriteStatepointsForGC.cpp.

rewrite statepoints for gc

Definition at line 135 of file RewriteStatepointsForGC.cpp.

cl::opt<bool> PrintBasePointers("spp-print-base-pointers", cl::Hidden, cl::init(false))
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<unsigned> RematerializationThreshold("spp-rematerialization-threshold", cl::Hidden, cl::init(6))
static

Referenced by rematerializeLiveValues().

rewrite statepoints for Make relocations at statepoints
explicit

Definition at line 135 of file RewriteStatepointsForGC.cpp.