LLVM 22.0.0git
GCRootLowering.cpp File Reference

Go to the source code of this file.

Functions

static bool DoLowering (Function &F, GCStrategy &S)
 Lower barriers out of existence (if the associated GCStrategy hasn't already done so...), and insert initializing stores to roots as a defensive measure.
 INITIALIZE_PASS_BEGIN (LowerIntrinsics, "gc-lowering", "GC Lowering", false, false) FunctionPass *llvm
static bool CouldBecomeSafePoint (Instruction *I)
 CouldBecomeSafePoint - Predicate to conservatively determine whether the instruction could introduce a safe point.
static bool InsertRootInitializers (Function &F, ArrayRef< AllocaInst * > Roots)
 INITIALIZE_PASS (GCMachineCodeAnalysis, "gc-analysis", "Analyze Machine Code For Garbage Collection", false, false) GCMachineCodeAnalysis

Function Documentation

◆ CouldBecomeSafePoint()

bool CouldBecomeSafePoint ( Instruction * I)
static

CouldBecomeSafePoint - Predicate to conservatively determine whether the instruction could introduce a safe point.

Definition at line 137 of file GCRootLowering.cpp.

References llvm::dyn_cast(), F, I, and llvm::isa().

Referenced by InsertRootInitializers().

◆ DoLowering()

bool DoLowering ( Function & F,
GCStrategy & S )
static

Lower barriers out of existence (if the associated GCStrategy hasn't already done so...), and insert initializing stores to roots as a defensive measure.

Given we're going to report all roots live at all safepoints, we need to be able to ensure each root has been initialized by the point the first safepoint is reached. This really should have been done by the frontend, but the old API made this non-obvious, so we do a potentially redundant store just in case.

Definition at line 204 of file GCRootLowering.cpp.

References llvm::cast(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), F, llvm::CallBase::getArgOperand(), llvm::CallBase::getCalledFunction(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Value::getType(), I, InsertRootInitializers(), llvm::make_early_inc_range(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Value::replaceAllUsesWith(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::Value::stripPointerCasts(), and llvm::Value::takeName().

Referenced by llvm::GCLoweringPass::run().

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( GCMachineCodeAnalysis ,
"gc-analysis" ,
"Analyze Machine Code For Garbage Collection" ,
false ,
false  )

Definition at line 257 of file GCRootLowering.cpp.

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( LowerIntrinsics ,
"gc-lowering" ,
"GC Lowering" ,
false ,
false  )

◆ InsertRootInitializers()