39 #define DEBUG_TYPE "ppc-vsx-copy"
69 return IsRegInClass(Reg, &PPC::VSRCRegClass, MRI);
73 return IsRegInClass(Reg, &PPC::VRRCRegClass, MRI);
77 return IsRegInClass(Reg, &PPC::F8RCRegClass, MRI);
94 if ( IsVSReg(DstMO.
getReg(), MRI) &&
95 !IsVSReg(SrcMO.
getReg(), MRI)) {
100 IsVRReg(SrcMO.
getReg(), MRI) ? &PPC::VSHRCRegClass :
102 assert((IsF8Reg(SrcMO.
getReg(), MRI) ||
103 IsVRReg(SrcMO.
getReg(), MRI)) &&
104 "Unknown source for a VSX copy");
117 }
else if (!IsVSReg(DstMO.
getReg(), MRI) &&
118 IsVSReg(SrcMO.
getReg(), MRI)) {
123 IsVRReg(DstMO.
getReg(), MRI) ? &PPC::VSHRCRegClass :
125 assert((IsF8Reg(DstMO.
getReg(), MRI) ||
126 IsVRReg(DstMO.
getReg(), MRI)) &&
127 "Unknown destination for a VSX copy");
153 bool Changed =
false;
171 "PowerPC VSX Copy Legalization",
false,
false)
173 char PPCVSXCopy::
ID = 0;
void initializePPCVSXCopyPass(PassRegistry &)
const MachineFunction * getParent() const
getParent - Return the MachineFunction containing this basic block.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
bool hasSubClassEq(const TargetRegisterClass *RC) const
hasSubClassEq - Returns true if RC is a sub-class of or equal to this class.
static bool isVirtualRegister(unsigned Reg)
isVirtualRegister - Return true if the specified register number is in the virtual register namespace...
COPY - Target-independent register copy.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
const TargetRegisterClass * getRegClass(unsigned Reg) const
getRegClass - Return the register class of the specified virtual register.
Reg
All possible values of the reg field in the ModR/M byte.
const MachineInstrBuilder & addImm(int64_t Val) const
addImm - Add a new immediate operand.
TargetInstrInfo - Interface to description of machine instruction set.
bundle_iterator< MachineInstr, instr_iterator > iterator
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const MachineOperand & getOperand(unsigned i) const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL, const MCInstrDesc &MCID)
BuildMI - Builder interface.
FunctionPass * createPPCVSXCopyPass()
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
const PPCInstrInfo * getInstrInfo() const override
MachineOperand class - Representation of each machine instruction operand.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
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.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
void setReg(unsigned Reg)
Change the register this operand corresponds to.
void setSubReg(unsigned subReg)
unsigned getReg() const
getReg - Returns the register number.
const MachineInstrBuilder & addOperand(const MachineOperand &MO) const
BasicBlockListType::iterator iterator
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
SUBREG_TO_REG - This instruction is similar to INSERT_SUBREG except that the first operand is an imme...
bool contains(unsigned Reg) const
contains - Return true if the specified register is included in this register class.