27 Value *Condition, *WidenableCondition;
40 for (
auto &Insn : *DeoptBB) {
43 if (Insn.mayHaveSideEffects())
46 DeoptBB = DeoptBB->getUniqueSuccessor();
49 }
while (Visited.
insert(DeoptBB).second);
54 Value *&WidenableCondition,
63 WidenableCondition = WC->get();
73 if (!BI || !BI->isConditional())
75 auto *
Cond = BI->getCondition();
76 if (!
Cond->hasOneUse())
79 IfTrueBB = BI->getSuccessor(0);
80 IfFalseBB = BI->getSuccessor(1);
83 WC = &BI->getOperandUse(0);
103 WC = &
And->getOperandUse(0);
104 C = &
And->getOperandUse(1);
110 WC = &
And->getOperandUse(1);
111 C = &
And->getOperandUse(0);
117template <
typename CallbackType>
119 CallbackType RecordCheckOrWidenableCond) {
122 Visited.
insert(Condition);
133 if (!RecordCheckOrWidenableCond(
Check))
135 }
while (!Worklist.
empty());
153 if (!BI || !BI->isConditional())
156 auto Condition = BI->getCondition();
157 if (!Condition->hasOneUse())
160 Value *WidenableCondition =
nullptr;
165 WidenableCondition =
Check;
170 return WidenableCondition;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static void parseCondition(Value *Condition, CallbackType RecordCheckOrWidenableCond)
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
const SmallVectorImpl< MachineOperand > & Cond
LLVM Basic Block Representation.
LLVM_ABI LLVMContext & getContext() const
Get the context in which this basic block lives.
static LLVM_ABI 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.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
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)
IntrinsicID_match m_Intrinsic()
Match intrinsic calls like this: m_Intrinsic<Intrinsic::fabs>(m_Value(X))
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
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.
Value * extractWidenableCondition(const User *U)
void parseWidenableGuard(const User *U, llvm::SmallVectorImpl< Value * > &Checks)
bool isGuard(const User *U)
Returns true iff U has semantics of a guard expressed in a form of call of llvm.experimental....
bool isWidenableCondition(const Value *V)
Returns true iff V has semantics of llvm.experimental.widenable.condition call.
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, extractWidenableCondition returns widenable condit...
bool isGuardAsWidenableBranch(const User *U)
Returns true iff U has semantics of a guard expressed in a form of a widenable conditional branch to ...
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.