33 auto matchMulOverflowCheck = [
X, &
II, &XIdx](
Value *V) {
34 auto *Extract = dyn_cast<ExtractValueInst>(V);
36 if (!Extract || !Extract->getIndices().equals(1))
39 II = dyn_cast<IntrinsicInst>(Extract->getAggregateOperand());
42 m_Intrinsic<Intrinsic::smul_with_overflow>())))
45 if (
II->getArgOperand(0) ==
X)
47 else if (
II->getArgOperand(1) ==
X)
55 (IsAnd && Pred == ICmpInst::Predicate::ICMP_NE &&
56 matchMulOverflowCheck(Op1)) ||
57 (!IsAnd && Pred == ICmpInst::Predicate::ICMP_EQ &&
63 Y = &
II->getArgOperandUse(!XIdx);
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
uint64_t IntrinsicInst * II
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
A wrapper class for inspecting calls to intrinsic functions.
A Use represents the edge between a Value definition and its users.
LLVM Value Representation.
bool match(Val *V, const Pattern &P)
CmpClass_match< LHS, RHS, ICmpInst, ICmpInst::Predicate > m_ICmp(ICmpInst::Predicate &Pred, const LHS &L, const RHS &R)
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
BinaryOp_match< cst_pred_ty< is_all_ones >, ValTy, Instruction::Xor, true > m_Not(const ValTy &V)
Matches a 'Not' as 'xor V, -1' or 'xor -1, V'.
is_zero m_Zero()
Match any null constant or a vector with all elements equal to 0.
match_combine_or< LTy, RTy > m_CombineOr(const LTy &L, const RTy &R)
Combine two pattern matchers matching L || R.
This is an optimization pass for GlobalISel generic memory operations.
bool isCheckForZeroAndMulWithOverflow(Value *Op0, Value *Op1, bool IsAnd, Use *&Y)
Match one of the patterns up to the select/logic op: Op0 = icmp ne i4 X, 0 Agg = call { i4,...