23#define DEBUG_TYPE "mips-set-machine-register-flags"
34 return "Mips Set Machine Register Flags";
49 "Mips Set Machine Register Flags",
false,
false)
51char MipsSetMachineRegisterFlags::
ID = 0;
53bool MipsSetMachineRegisterFlags::runOnMachineFunction(
MachineFunction &MF) {
55 *
static_cast<const MipsInstrInfo *
>(MF.getSubtarget().getInstrInfo());
66bool MipsSetMachineRegisterFlags::processBasicBlock(
74 MachineInstr &
MI = *MII;
78 unsigned Opcode =
MI.getOpcode();
79 if (Opcode >= Mips::CMP_AF_D_MMR6 && Opcode <= Mips::CMP_UN_S_MMR6) {
80 MachineOperand &DestOperand =
MI.getOperand(0);
85 MI.setFlag(MachineInstr::MIFlag::NoSWrap);
87 }
else if (Opcode == Mips::COPY) {
88 MachineOperand &SrcOperand =
MI.getOperand(1);
91 if (Src.isVirtual() &&
93 MI.setFlag(MachineInstr::MIFlag::NoSWrap);
95 }
else if (Opcode == Mips::INSERT_SUBREG) {
96 MachineOperand &SrcOperand =
MI.getOperand(2);
99 if (Src.isVirtual() &&
101 MI.setFlag(MachineInstr::MIFlag::NoSWrap);
110 return new MipsSetMachineRegisterFlags();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Promote Memory to Register
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
FunctionPass class - This class is used to implement most global optimizations.
MachineInstrBundleIterator< MachineInstr > iterator
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
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,...
const TargetRegisterClass * getRegClassOrNull(Register Reg) const
Return the register class of Reg, or null if Reg has not been assigned a register class yet.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
MipsII - This namespace holds all of the target specific flags that instruction info tracks.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
FunctionPass * createMipsSetMachineRegisterFlagsPass()