26 if (
F.isDeclaration())
32 if (
auto *GCR = dyn_cast<GCRelocateInst>(&
I))
33 if (isa<GCStatepointInst>(GCR->getOperand(0)))
39 Value *OrigPtr = GCRel->getDerivedPtr();
40 Value *ReplaceGCRel = OrigPtr;
44 if (GCRel->getType() != OrigPtr->
getType())
45 ReplaceGCRel =
new BitCastInst(OrigPtr, GCRel->
getType(),
"cast", GCRel->getIterator());
50 GCRel->replaceAllUsesWith(ReplaceGCRel);
51 GCRel->eraseFromParent();
53 return !GCRelocates.
empty();
Expand Atomic instructions
static bool stripGCRelocates(Function &F)
A container for analyses that lazily runs them and caches their results.
This class represents a no-op cast from one type to another.
Represents analyses that only rely on functions' control flow.
Represents calls to the gc.relocate intrinsic.
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.
This is an optimization pass for GlobalISel generic memory operations.