14 using namespace MIPatternMatch;
16 std::tuple<Register, unsigned, MachineInstr *>
20 return std::make_tuple(Reg, 0,
nullptr);
22 if (Def->
getOpcode() == TargetOpcode::G_CONSTANT) {
30 return std::make_tuple(
Register(), Offset, Def);
34 if (Def->
getOpcode() == TargetOpcode::G_ADD) {
44 return std::make_tuple(Reg, 0, Def);
This class represents lattice values for constants.
bool mi_match(Reg R, const MachineRegisterInfo &MRI, Pattern &&P)
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
MachineInstr * getDefIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI)
Find the def instruction for Reg, folding away any trivial copies.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
UnaryOp_match< SrcTy, TargetOpcode::COPY > m_Copy(SrcTy &&Src)
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
unsigned const MachineRegisterInfo * MRI
This file contains the declarations for the subclasses of Constant, which represent the different fla...
MachineOperand class - Representation of each machine instruction operand.
Promote Memory to Register
std::tuple< Register, unsigned, MachineInstr * > getBaseWithConstantOffset(MachineRegisterInfo &MRI, Register Reg)
Returns Base register, constant offset, and offset def point.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
ConstantMatch m_ICst(int64_t &Cst)
Register getReg() const
getReg - Returns the register number.
const MachineOperand & getOperand(unsigned i) const
const ConstantInt * getCImm() const
Wrapper class representing virtual and physical registers.