43 bool StripGCRelocates::runOnFunction(
Function &
F) {
51 if (
auto *GCR = dyn_cast<GCRelocateInst>(&
I))
58 Value *OrigPtr = GCRel->getDerivedPtr();
59 Value *ReplaceGCRel = OrigPtr;
63 if (GCRel->getType() != OrigPtr->
getType())
70 GCRel->eraseFromParent();
72 return !GCRelocates.empty();
76 "Strip gc.relocates inserted through RewriteStatepointsForGC",
79 return new StripGCRelocates();
void push_back(const T &Elt)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
FunctionPass * createStripGCRelocatesPass()
This class represents a no-op cast from one type to another.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
Represent the analysis usage information of a pass.
void initializeStripGCRelocatesPass(PassRegistry &)
FunctionPass class - This class is used to implement most global optimizations.
INITIALIZE_PASS(StripGCRelocates,"strip-gc-relocates","Strip gc.relocates inserted through RewriteStatepointsForGC", true, false) FunctionPass *llvm
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Type * getType() const
All values are typed, get the type of this value.
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
bool isStatepoint(ImmutableCallSite CS)
Represents calls to the gc.relocate intrinsic.
LLVM Value Representation.
inst_range instructions(Function *F)