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