Go to the documentation of this file.
28 if (
F.isDeclaration())
34 if (
auto *GCR = dyn_cast<GCRelocateInst>(&
I))
35 if (isa<GCStatepointInst>(GCR->getOperand(0)))
36 GCRelocates.push_back(GCR);
41 Value *OrigPtr = GCRel->getDerivedPtr();
42 Value *ReplaceGCRel = OrigPtr;
46 if (GCRel->getType() != OrigPtr->
getType())
52 GCRel->replaceAllUsesWith(ReplaceGCRel);
53 GCRel->eraseFromParent();
55 return !GCRelocates.empty();
85 "Strip gc.relocates inserted through RewriteStatepointsForGC",
A set of analyses that are preserved following a run of a transformation pass.
This is an optimization pass for GlobalISel generic memory operations.
This class represents a no-op cast from one type to another.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Represent the analysis usage information of a pass.
Analysis containing CSE Info
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
inst_range instructions(Function *F)
Represents calls to the gc.relocate intrinsic.
void initializeStripGCRelocatesLegacyPass(PassRegistry &)
Type * getType() const
All values are typed, get the type of this value.
Represents analyses that only rely on functions' control flow.
static bool runOnFunction(Function &F, bool PostInlining)
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
void preserveSet()
Mark an analysis set as preserved.
A container for analyses that lazily runs them and caches their results.
FunctionPass class - This class is used to implement most global optimizations.
LLVM Value Representation.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static bool stripGCRelocates(Function &F)