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")
An abstraction over a floating-point predicate, and a pack of an integer predicate with samesign info...
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)
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
CmpClass_match< LHS, RHS, ICmpInst > m_ICmp(CmpPredicate &Pred, const LHS &L, const RHS &R)
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,...