19 return match(U, m_Intrinsic<Intrinsic::experimental_guard>());
23 Value *Condition, *WidenableCondition;
30 Value *Condition, *WidenableCondition;
35 for (
auto &Insn : *DeoptBB) {
36 if (
match(&Insn, m_Intrinsic<Intrinsic::experimental_deoptimize>()))
38 if (Insn.mayHaveSideEffects())
45 Value *&WidenableCondition,
54 WidenableCondition = WC->get();
64 if (!BI || !BI->isConditional())
66 auto *Cond = BI->getCondition();
67 if (!Cond->hasOneUse())
70 IfTrueBB = BI->getSuccessor(0);
71 IfFalseBB = BI->getSuccessor(1);
73 if (
match(Cond, m_Intrinsic<Intrinsic::experimental_widenable_condition>())) {
74 WC = &BI->getOperandUse(0);
92 if (
match(A, m_Intrinsic<Intrinsic::experimental_widenable_condition>()) &&
94 WC = &And->getOperandUse(0);
95 C = &And->getOperandUse(1);
99 if (
match(B, m_Intrinsic<Intrinsic::experimental_widenable_condition>()) &&
101 WC = &And->getOperandUse(1);
102 C = &And->getOperandUse(0);
bool isWidenableBranch(const User *U)
Returns true iff U is a widenable branch (that is, parseWidenableBranch returns true).
BinaryOp_match< LHS, RHS, Instruction::And > m_And(const LHS &L, const RHS &R)
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
This class represents lattice values for constants.
LLVMContext & getContext() const
Get the context in which this basic block lives.
bool match(Val *V, const Pattern &P)
A Use represents the edge between a Value definition and its users.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
LLVM Basic Block Representation.
Conditional or Unconditional Branch instruction.
bool parseWidenableBranch(const User *U, Value *&Condition, Value *&WidenableCondition, BasicBlock *&IfTrueBB, BasicBlock *&IfFalseBB)
If U is widenable branch looking like: cond = ...
static ConstantInt * getTrue(LLVMContext &Context)
bool isGuard(const User *U)
Returns true iff U has semantics of a guard expressed in a form of call of llvm.experimental.guard intrinsic.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
LLVM Value Representation.
bool isGuardAsWidenableBranch(const User *U)
Returns true iff U has semantics of a guard expressed in a form of a widenable conditional branch to ...
bool hasOneUse() const
Return true if there is exactly one user of this value.