32 struct LowerGuardIntrinsicLegacyPass :
public FunctionPass {
48 if (!GuardDecl || GuardDecl->use_empty())
63 for (
auto *CI : ToLower) {
65 CI->eraseFromParent();
77 "Lower the guard intrinsic to normal control flow",
false,
81 return new LowerGuardIntrinsicLegacyPass();
Pass interface - Implemented by all 'passes'.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This class represents lattice values for constants.
void makeGuardControlFlowExplicit(Function *DeoptIntrinsic, CallInst *Guard)
Splits control flow at point of Guard, replacing it with explicit branch by the condition of guard's ...
void push_back(const T &Elt)
static bool lowerGuardIntrinsic(Function &F)
INITIALIZE_PASS(LowerGuardIntrinsicLegacyPass, "lower-guard-intrinsic", "Lower the guard intrinsic to normal control flow", false, false) Pass *llvm
StringRef getName(ID id)
Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
Function * getDeclaration(Module *M, ID id, ArrayRef< Type *> Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static bool runOnFunction(Function &F, bool PostInlining)
void setCallingConv(CallingConv::ID CC)
Type * getReturnType() const
Returns the type of the ret val.
A set of analyses that are preserved following a run of a transformation pass.
FunctionPass class - This class is used to implement most global optimizations.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Pass * createLowerGuardIntrinsicPass()
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
bool isGuard(const User *U)
Returns true iff U has semantics of a guard.
Function * getFunction(StringRef Name) const
Look up the specified function in the module symbol table.
LLVM_NODISCARD bool empty() const
Module * getParent()
Get the module that this global value is contained inside of...
inst_range instructions(Function *F)
A container for analyses that lazily runs them and caches their results.
void initializeLowerGuardIntrinsicLegacyPassPass(PassRegistry &)