28 F.getParent(), Intrinsic::experimental_guard);
29 if (!GuardDecl || GuardDecl->use_empty())
36 for (
auto *U : GuardDecl->users())
38 if (CI->getFunction() == &
F)
45 F.getParent(), Intrinsic::experimental_deoptimize, {F.getReturnType()});
46 DeoptIntrinsic->setCallingConv(GuardDecl->getCallingConv());
48 for (
auto *CI : ToLower) {
50 CI->eraseFromParent();
static bool lowerGuardIntrinsic(Function &F)
This file defines the SmallVector class.
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.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVM_ABI Function * getOrInsertDeclaration(Module *M, ID id, ArrayRef< Type * > Tys={})
Look up the Function declaration of the intrinsic id in the Module M.
LLVM_ABI Function * getDeclarationIfExists(const Module *M, ID id)
Look up the Function declaration of the intrinsic id in the Module M and return it if it exists.
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.
void makeGuardControlFlowExplicit(Function *DeoptIntrinsic, CallInst *Guard, bool UseWC)
Splits control flow at point of Guard, replacing it with explicit branch by the condition of guard's ...
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)