21#define DEBUG_TYPE "gi-match-table-executor"
37 return VRegVal->Value.getSExtValue() ==
Value;
41 return VRegVal->getSExtValue() ==
Value;
62 std::next(
MI.getIterator()) == IntoMIIter)
66 if (
MI.isConvergent() &&
MI.getParent() != IntoMI.
getParent())
69 if (
MI.isLoadFoldBarrier())
74 if (
MI.memoperands_empty())
76 auto &MMO = **(
MI.memoperands_begin());
77 if (MMO.isAtomic() || MMO.isVolatile())
82 const unsigned MaxIter = 20;
85 if (CurrMI.isLoadFoldBarrier())
88 if (Iter++ == MaxIter)
Contains matchers for matching SSA Machine Instructions.
LLVM_ABI GIMatchTableExecutor()
LLVM_ABI bool isBaseWithConstantOffset(const MachineOperand &Root, const MachineRegisterInfo &MRI) const
Return true if the specified operand is a G_PTR_ADD with a G_CONSTANT on the right-hand side.
LLVM_ABI bool isOperandImmEqual(const MachineOperand &MO, int64_t Value, const MachineRegisterInfo &MRI, bool Splat=false) const
LLVM_ABI bool isObviouslySafeToFold(MachineInstr &MI, MachineInstr &IntoMI) const
Return true if MI can obviously be folded into IntoMI.
Representation of each machine instruction.
const MachineBasicBlock * getParent() const
MachineOperand class - Representation of each machine instruction operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Register getReg() const
getReg - Returns the register number.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
LLVM Value Representation.
self_iterator getIterator()
operand_type_match m_Reg()
GInstrBind< GConstant > m_GConstant(GConstant *&Inst)
Match a literal G_CONSTANT instruction (no look-through of splats or copies).
bool mi_match(Reg R, const MachineRegisterInfo &MRI, Pattern &&P)
BinaryOp_match< LHS, RHS, TargetOpcode::G_PTR_ADD, false > m_GPtrAdd(const LHS &L, const RHS &R)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::optional< APInt > getIConstantSplatVal(const Register Reg, const MachineRegisterInfo &MRI)
auto instructionsWithoutDebug(IterT It, IterT End, bool SkipPseudoOp=true)
Construct a range iterator which begins at It and moves forwards until End is reached,...
LLVM_ABI std::optional< ValueAndVReg > getIConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_CONSTANT returns its...
LLVM_ABI MatcherState(unsigned MaxRenderers)
std::vector< ComplexRendererFns::value_type > Renderers