23#define DEBUG_TYPE "bpf-ir-peephole"
29static bool BPFIRPeepholeImpl(
Function &
F) {
59 if (
II->getIntrinsicID() != Intrinsic::stacksave)
61 if (!
II->hasOneUser())
67 Inst->eraseFromParent();
73 if (!LD->hasOneUser())
78 if (
II->getIntrinsicID() != Intrinsic::stackrestore)
83 II->eraseFromParent();
This header defines various interfaces for pass management in LLVM.
uint64_t IntrinsicInst * II
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
LLVM_ABI InstListType::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.