19 return match(U, m_Intrinsic<Intrinsic::experimental_guard>());
23 Value *Condition, *WidenableCondition;
30 Value *Condition, *WidenableCondition;
38 for (
auto &
Insn : *DeoptBB) {
39 if (
match(&
Insn, m_Intrinsic<Intrinsic::experimental_deoptimize>()))
41 if (
Insn.mayHaveSideEffects())
44 DeoptBB = DeoptBB->getUniqueSuccessor();
47 }
while (Visited.
insert(DeoptBB).second);
52 Value *&WidenableCondition,
61 WidenableCondition = WC->get();
70 auto *BI = dyn_cast<BranchInst>(U);
71 if (!BI || !BI->isConditional())
73 auto *
Cond = BI->getCondition();
74 if (!
Cond->hasOneUse())
77 IfTrueBB = BI->getSuccessor(0);
78 IfFalseBB = BI->getSuccessor(1);
80 if (
match(
Cond, m_Intrinsic<Intrinsic::experimental_widenable_condition>())) {
81 WC = &BI->getOperandUse(0);
94 auto *
And = dyn_cast<Instruction>(
Cond);
99 if (
match(
A, m_Intrinsic<Intrinsic::experimental_widenable_condition>()) &&
101 WC = &
And->getOperandUse(0);
102 C = &
And->getOperandUse(1);
106 if (
match(
B, m_Intrinsic<Intrinsic::experimental_widenable_condition>()) &&
108 WC = &
And->getOperandUse(1);
109 C = &
And->getOperandUse(0);
SmallVector< AArch64_IMM::ImmInsnModel, 4 > Insn
SmallVector< MachineOperand, 4 > Cond
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
LLVM Basic Block Representation.
LLVMContext & getContext() const
Get the context in which this basic block lives.
static ConstantInt * getTrue(LLVMContext &Context)
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
A Use represents the edge between a Value definition and its users.
LLVM Value Representation.
@ C
The default llvm calling convention, compatible with C.
BinaryOp_match< LHS, RHS, Instruction::And > m_And(const LHS &L, const RHS &R)
bool match(Val *V, const Pattern &P)
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
This is an optimization pass for GlobalISel generic memory operations.
bool isGuard(const User *U)
Returns true iff U has semantics of a guard expressed in a form of call of llvm.experimental....
bool parseWidenableBranch(const User *U, Value *&Condition, Value *&WidenableCondition, BasicBlock *&IfTrueBB, BasicBlock *&IfFalseBB)
If U is widenable branch looking like: cond = ... wc = call i1 @llvm.experimental....
bool isWidenableBranch(const User *U)
Returns true iff U is a widenable branch (that is, parseWidenableBranch returns true).
bool isGuardAsWidenableBranch(const User *U)
Returns true iff U has semantics of a guard expressed in a form of a widenable conditional branch to ...
@ And
Bitwise or logical AND of integers.