Use MCRegister in copyPhysReg

This commit is contained in:
Matt Arsenault 2019-11-11 13:54:21 +05:30 committed by Matt Arsenault
parent a26d7b6298
commit e6c9a9af39
45 changed files with 99 additions and 99 deletions

View File

@ -920,7 +920,7 @@ public:
/// large registers. See for example the ARM target. /// large registers. See for example the ARM target.
virtual void copyPhysReg(MachineBasicBlock &MBB, virtual void copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, const DebugLoc &DL, MachineBasicBlock::iterator MI, const DebugLoc &DL,
unsigned DestReg, unsigned SrcReg, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const { bool KillSrc) const {
llvm_unreachable("Target didn't implement TargetInstrInfo::copyPhysReg!"); llvm_unreachable("Target didn't implement TargetInstrInfo::copyPhysReg!");
} }

View File

@ -2409,8 +2409,8 @@ static bool forwardCopyWillClobberTuple(unsigned DestReg, unsigned SrcReg,
void AArch64InstrInfo::copyPhysRegTuple(MachineBasicBlock &MBB, void AArch64InstrInfo::copyPhysRegTuple(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc, MCRegister SrcReg, bool KillSrc,
unsigned Opcode, unsigned Opcode,
ArrayRef<unsigned> Indices) const { ArrayRef<unsigned> Indices) const {
assert(Subtarget.hasNEON() && "Unexpected register copy without NEON"); assert(Subtarget.hasNEON() && "Unexpected register copy without NEON");
@ -2461,8 +2461,8 @@ void AArch64InstrInfo::copyGPRRegTuple(MachineBasicBlock &MBB,
void AArch64InstrInfo::copyPhysReg(MachineBasicBlock &MBB, void AArch64InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
if (AArch64::GPR32spRegClass.contains(DestReg) && if (AArch64::GPR32spRegClass.contains(DestReg) &&
(AArch64::GPR32spRegClass.contains(SrcReg) || SrcReg == AArch64::WZR)) { (AArch64::GPR32spRegClass.contains(SrcReg) || SrcReg == AArch64::WZR)) {
const TargetRegisterInfo *TRI = &getRegisterInfo(); const TargetRegisterInfo *TRI = &getRegisterInfo();
@ -2471,10 +2471,10 @@ void AArch64InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
// If either operand is WSP, expand to ADD #0. // If either operand is WSP, expand to ADD #0.
if (Subtarget.hasZeroCycleRegMove()) { if (Subtarget.hasZeroCycleRegMove()) {
// Cyclone recognizes "ADD Xd, Xn, #0" as a zero-cycle register move. // Cyclone recognizes "ADD Xd, Xn, #0" as a zero-cycle register move.
unsigned DestRegX = TRI->getMatchingSuperReg(DestReg, AArch64::sub_32, MCRegister DestRegX = TRI->getMatchingSuperReg(
&AArch64::GPR64spRegClass); DestReg, AArch64::sub_32, &AArch64::GPR64spRegClass);
unsigned SrcRegX = TRI->getMatchingSuperReg(SrcReg, AArch64::sub_32, MCRegister SrcRegX = TRI->getMatchingSuperReg(
&AArch64::GPR64spRegClass); SrcReg, AArch64::sub_32, &AArch64::GPR64spRegClass);
// This instruction is reading and writing X registers. This may upset // This instruction is reading and writing X registers. This may upset
// the register scavenger and machine verifier, so we need to indicate // the register scavenger and machine verifier, so we need to indicate
// that we are reading an undefined value from SrcRegX, but a proper // that we are reading an undefined value from SrcRegX, but a proper
@ -2497,10 +2497,10 @@ void AArch64InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
} else { } else {
if (Subtarget.hasZeroCycleRegMove()) { if (Subtarget.hasZeroCycleRegMove()) {
// Cyclone recognizes "ORR Xd, XZR, Xm" as a zero-cycle register move. // Cyclone recognizes "ORR Xd, XZR, Xm" as a zero-cycle register move.
unsigned DestRegX = TRI->getMatchingSuperReg(DestReg, AArch64::sub_32, MCRegister DestRegX = TRI->getMatchingSuperReg(
&AArch64::GPR64spRegClass); DestReg, AArch64::sub_32, &AArch64::GPR64spRegClass);
unsigned SrcRegX = TRI->getMatchingSuperReg(SrcReg, AArch64::sub_32, MCRegister SrcRegX = TRI->getMatchingSuperReg(
&AArch64::GPR64spRegClass); SrcReg, AArch64::sub_32, &AArch64::GPR64spRegClass);
// This instruction is reading and writing X registers. This may upset // This instruction is reading and writing X registers. This may upset
// the register scavenger and machine verifier, so we need to indicate // the register scavenger and machine verifier, so we need to indicate
// that we are reading an undefined value from SrcRegX, but a proper // that we are reading an undefined value from SrcRegX, but a proper

View File

@ -131,15 +131,15 @@ public:
unsigned NumLoads) const override; unsigned NumLoads) const override;
void copyPhysRegTuple(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysRegTuple(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg,
bool KillSrc, unsigned Opcode, MCRegister SrcReg, bool KillSrc, unsigned Opcode,
llvm::ArrayRef<unsigned> Indices) const; llvm::ArrayRef<unsigned> Indices) const;
void copyGPRRegTuple(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyGPRRegTuple(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
DebugLoc DL, unsigned DestReg, unsigned SrcReg, DebugLoc DL, unsigned DestReg, unsigned SrcReg,
bool KillSrc, unsigned Opcode, unsigned ZeroReg, bool KillSrc, unsigned Opcode, unsigned ZeroReg,
llvm::ArrayRef<unsigned> Indices) const; llvm::ArrayRef<unsigned> Indices) const;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,

View File

@ -60,8 +60,8 @@ bool R600InstrInfo::isVector(const MachineInstr &MI) const {
void R600InstrInfo::copyPhysReg(MachineBasicBlock &MBB, void R600InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
unsigned VectorComponents = 0; unsigned VectorComponents = 0;
if ((R600::R600_Reg128RegClass.contains(DestReg) || if ((R600::R600_Reg128RegClass.contains(DestReg) ||
R600::R600_Reg128VerticalRegClass.contains(DestReg)) && R600::R600_Reg128VerticalRegClass.contains(DestReg)) &&

View File

@ -73,7 +73,7 @@ public:
} }
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
bool isLegalToSplitMBBAt(MachineBasicBlock &MBB, bool isLegalToSplitMBBAt(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI) const override; MachineBasicBlock::iterator MBBI) const override;

View File

@ -508,8 +508,8 @@ bool SIInstrInfo::shouldScheduleLoadsNear(SDNode *Load0, SDNode *Load1,
static void reportIllegalCopy(const SIInstrInfo *TII, MachineBasicBlock &MBB, static void reportIllegalCopy(const SIInstrInfo *TII, MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) { MCRegister SrcReg, bool KillSrc) {
MachineFunction *MF = MBB.getParent(); MachineFunction *MF = MBB.getParent();
DiagnosticInfoUnsupported IllegalCopy(MF->getFunction(), DiagnosticInfoUnsupported IllegalCopy(MF->getFunction(),
"illegal SGPR to VGPR copy", "illegal SGPR to VGPR copy",
@ -523,8 +523,8 @@ static void reportIllegalCopy(const SIInstrInfo *TII, MachineBasicBlock &MBB,
void SIInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void SIInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
const TargetRegisterClass *RC = RI.getPhysRegClass(DestReg); const TargetRegisterClass *RC = RI.getPhysRegClass(DestReg);
if (RC == &AMDGPU::VGPR_32RegClass) { if (RC == &AMDGPU::VGPR_32RegClass) {

View File

@ -192,7 +192,7 @@ public:
int64_t Offset1, unsigned NumLoads) const override; int64_t Offset1, unsigned NumLoads) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
unsigned calculateLDSSpillAddress(MachineBasicBlock &MBB, MachineInstr &MI, unsigned calculateLDSSpillAddress(MachineBasicBlock &MBB, MachineInstr &MI,

View File

@ -280,8 +280,8 @@ unsigned ARCInstrInfo::removeBranch(MachineBasicBlock &MBB,
void ARCInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void ARCInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &dl, unsigned DestReg, const DebugLoc &dl, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
assert(ARC::GPR32RegClass.contains(SrcReg) && assert(ARC::GPR32RegClass.contains(SrcReg) &&
"Only GPR32 src copy supported."); "Only GPR32 src copy supported.");
assert(ARC::GPR32RegClass.contains(DestReg) && assert(ARC::GPR32RegClass.contains(DestReg) &&

View File

@ -64,7 +64,7 @@ public:
int *BytesRemoved = nullptr) const override; int *BytesRemoved = nullptr) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &dl, unsigned DestReg, unsigned SrcReg, const DebugLoc &dl, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,

View File

@ -829,8 +829,8 @@ void llvm::addPredicatedMveVpredROp(MachineInstrBuilder &MIB,
void ARMBaseInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void ARMBaseInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
bool GPRDest = ARM::GPRRegClass.contains(DestReg); bool GPRDest = ARM::GPRRegClass.contains(DestReg);
bool GPRSrc = ARM::GPRRegClass.contains(SrcReg); bool GPRSrc = ARM::GPRRegClass.contains(SrcReg);

View File

@ -202,7 +202,7 @@ public:
const ARMSubtarget &Subtarget) const; const ARMSubtarget &Subtarget) const;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,

View File

@ -37,8 +37,8 @@ unsigned Thumb1InstrInfo::getUnindexedOpcode(unsigned Opc) const {
void Thumb1InstrInfo::copyPhysReg(MachineBasicBlock &MBB, void Thumb1InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
// Need to check the arch. // Need to check the arch.
MachineFunction &MF = *MBB.getParent(); MachineFunction &MF = *MBB.getParent();
const ARMSubtarget &st = MF.getSubtarget<ARMSubtarget>(); const ARMSubtarget &st = MF.getSubtarget<ARMSubtarget>();

View File

@ -38,7 +38,7 @@ public:
const ThumbRegisterInfo &getRegisterInfo() const override { return RI; } const ThumbRegisterInfo &getRegisterInfo() const override { return RI; }
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI, MachineBasicBlock::iterator MBBI,

View File

@ -120,8 +120,8 @@ Thumb2InstrInfo::isLegalToSplitMBBAt(MachineBasicBlock &MBB,
void Thumb2InstrInfo::copyPhysReg(MachineBasicBlock &MBB, void Thumb2InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
// Handle SPR, DPR, and QPR copies. // Handle SPR, DPR, and QPR copies.
if (!ARM::GPRRegClass.contains(DestReg, SrcReg)) if (!ARM::GPRRegClass.contains(DestReg, SrcReg))
return ARMBaseInstrInfo::copyPhysReg(MBB, I, DL, DestReg, SrcReg, KillSrc); return ARMBaseInstrInfo::copyPhysReg(MBB, I, DL, DestReg, SrcReg, KillSrc);

View File

@ -39,7 +39,7 @@ public:
MachineBasicBlock::iterator MBBI) const override; MachineBasicBlock::iterator MBBI) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,

View File

@ -40,8 +40,8 @@ AVRInstrInfo::AVRInstrInfo()
void AVRInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void AVRInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
const AVRSubtarget &STI = MBB.getParent()->getSubtarget<AVRSubtarget>(); const AVRSubtarget &STI = MBB.getParent()->getSubtarget<AVRSubtarget>();
const AVRRegisterInfo &TRI = *STI.getRegisterInfo(); const AVRRegisterInfo &TRI = *STI.getRegisterInfo();
unsigned Opc; unsigned Opc;

View File

@ -72,7 +72,7 @@ public:
unsigned getInstSizeInBytes(const MachineInstr &MI) const override; unsigned getInstSizeInBytes(const MachineInstr &MI) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, unsigned SrcReg, MachineBasicBlock::iterator MI, unsigned SrcReg,

View File

@ -30,8 +30,8 @@ BPFInstrInfo::BPFInstrInfo()
void BPFInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void BPFInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
if (BPF::GPRRegClass.contains(DestReg, SrcReg)) if (BPF::GPRRegClass.contains(DestReg, SrcReg))
BuildMI(MBB, I, DL, get(BPF::MOV_rr), DestReg) BuildMI(MBB, I, DL, get(BPF::MOV_rr), DestReg)
.addReg(SrcReg, getKillRegState(KillSrc)); .addReg(SrcReg, getKillRegState(KillSrc));

View File

@ -30,7 +30,7 @@ public:
const BPFRegisterInfo &getRegisterInfo() const { return RI; } const BPFRegisterInfo &getRegisterInfo() const { return RI; }
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
bool expandPostRAPseudo(MachineInstr &MI) const override; bool expandPostRAPseudo(MachineInstr &MI) const override;

View File

@ -786,8 +786,8 @@ bool HexagonInstrInfo::isProfitableToDupForIfCvt(MachineBasicBlock &MBB,
void HexagonInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void HexagonInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
const HexagonRegisterInfo &HRI = *Subtarget.getRegisterInfo(); const HexagonRegisterInfo &HRI = *Subtarget.getRegisterInfo();
unsigned KillFlag = getKillRegState(KillSrc); unsigned KillFlag = getKillRegState(KillSrc);

View File

@ -173,7 +173,7 @@ public:
/// careful implementation when multiple copy instructions are required for /// careful implementation when multiple copy instructions are required for
/// large registers. See for example the ARM target. /// large registers. See for example the ARM target.
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
/// Store the specified register of the given register class to the specified /// Store the specified register of the given register class to the specified

View File

@ -34,8 +34,8 @@ LanaiInstrInfo::LanaiInstrInfo()
void LanaiInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void LanaiInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator Position, MachineBasicBlock::iterator Position,
const DebugLoc &DL, const DebugLoc &DL,
unsigned DestinationRegister, MCRegister DestinationRegister,
unsigned SourceRegister, MCRegister SourceRegister,
bool KillSource) const { bool KillSource) const {
if (!Lanai::GPRRegClass.contains(DestinationRegister, SourceRegister)) { if (!Lanai::GPRRegClass.contains(DestinationRegister, SourceRegister)) {
llvm_unreachable("Impossible reg-to-reg copy"); llvm_unreachable("Impossible reg-to-reg copy");

View File

@ -48,8 +48,8 @@ public:
int &FrameIndex) const override; int &FrameIndex) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator Position, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator Position,
const DebugLoc &DL, unsigned DestinationRegister, const DebugLoc &DL, MCRegister DestinationRegister,
unsigned SourceRegister, bool KillSource) const override; MCRegister SourceRegister, bool KillSource) const override;
void void
storeRegToStackSlot(MachineBasicBlock &MBB, storeRegToStackSlot(MachineBasicBlock &MBB,

View File

@ -89,8 +89,8 @@ void MSP430InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
void MSP430InstrInfo::copyPhysReg(MachineBasicBlock &MBB, void MSP430InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
unsigned Opc; unsigned Opc;
if (MSP430::GR16RegClass.contains(DestReg, SrcReg)) if (MSP430::GR16RegClass.contains(DestReg, SrcReg))
Opc = MSP430::MOV16rr; Opc = MSP430::MOV16rr;

View File

@ -36,7 +36,7 @@ public:
const TargetRegisterInfo &getRegisterInfo() const { return RI; } const TargetRegisterInfo &getRegisterInfo() const { return RI; }
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,

View File

@ -68,8 +68,8 @@ unsigned Mips16InstrInfo::isStoreToStackSlot(const MachineInstr &MI,
void Mips16InstrInfo::copyPhysReg(MachineBasicBlock &MBB, void Mips16InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
unsigned Opc = 0; unsigned Opc = 0;
if (Mips::CPU16RegsRegClass.contains(DestReg) && if (Mips::CPU16RegsRegClass.contains(DestReg) &&

View File

@ -49,7 +49,7 @@ public:
int &FrameIndex) const override; int &FrameIndex) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStack(MachineBasicBlock &MBB, void storeRegToStack(MachineBasicBlock &MBB,

View File

@ -82,8 +82,8 @@ unsigned MipsSEInstrInfo::isStoreToStackSlot(const MachineInstr &MI,
void MipsSEInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void MipsSEInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
unsigned Opc = 0, ZeroReg = 0; unsigned Opc = 0, ZeroReg = 0;
bool isMicroMips = Subtarget.inMicroMipsMode(); bool isMicroMips = Subtarget.inMicroMipsMode();

View File

@ -43,7 +43,7 @@ public:
int &FrameIndex) const override; int &FrameIndex) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStack(MachineBasicBlock &MBB, void storeRegToStack(MachineBasicBlock &MBB,

View File

@ -31,8 +31,8 @@ NVPTXInstrInfo::NVPTXInstrInfo() : NVPTXGenInstrInfo(), RegInfo() {}
void NVPTXInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void NVPTXInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
const MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo(); const MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo();
const TargetRegisterClass *DestRC = MRI.getRegClass(DestReg); const TargetRegisterClass *DestRC = MRI.getRegClass(DestReg);
const TargetRegisterClass *SrcRC = MRI.getRegClass(SrcReg); const TargetRegisterClass *SrcRC = MRI.getRegClass(SrcReg);

View File

@ -49,7 +49,7 @@ public:
*/ */
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
// Branch analysis. // Branch analysis.

View File

@ -903,14 +903,14 @@ static unsigned getCRBitValue(unsigned CRBit) {
void PPCInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void PPCInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
// We can end up with self copies and similar things as a result of VSX copy // We can end up with self copies and similar things as a result of VSX copy
// legalization. Promote them here. // legalization. Promote them here.
const TargetRegisterInfo *TRI = &getRegisterInfo(); const TargetRegisterInfo *TRI = &getRegisterInfo();
if (PPC::F8RCRegClass.contains(DestReg) && if (PPC::F8RCRegClass.contains(DestReg) &&
PPC::VSRCRegClass.contains(SrcReg)) { PPC::VSRCRegClass.contains(SrcReg)) {
unsigned SuperReg = MCRegister SuperReg =
TRI->getMatchingSuperReg(DestReg, PPC::sub_64, &PPC::VSRCRegClass); TRI->getMatchingSuperReg(DestReg, PPC::sub_64, &PPC::VSRCRegClass);
if (VSXSelfCopyCrash && SrcReg == SuperReg) if (VSXSelfCopyCrash && SrcReg == SuperReg)
@ -919,7 +919,7 @@ void PPCInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
DestReg = SuperReg; DestReg = SuperReg;
} else if (PPC::F8RCRegClass.contains(SrcReg) && } else if (PPC::F8RCRegClass.contains(SrcReg) &&
PPC::VSRCRegClass.contains(DestReg)) { PPC::VSRCRegClass.contains(DestReg)) {
unsigned SuperReg = MCRegister SuperReg =
TRI->getMatchingSuperReg(SrcReg, PPC::sub_64, &PPC::VSRCRegClass); TRI->getMatchingSuperReg(SrcReg, PPC::sub_64, &PPC::VSRCRegClass);
if (VSXSelfCopyCrash && DestReg == SuperReg) if (VSXSelfCopyCrash && DestReg == SuperReg)
@ -931,7 +931,7 @@ void PPCInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
// Different class register copy // Different class register copy
if (PPC::CRBITRCRegClass.contains(SrcReg) && if (PPC::CRBITRCRegClass.contains(SrcReg) &&
PPC::GPRCRegClass.contains(DestReg)) { PPC::GPRCRegClass.contains(DestReg)) {
unsigned CRReg = getCRFromCRBit(SrcReg); MCRegister CRReg = getCRFromCRBit(SrcReg);
BuildMI(MBB, I, DL, get(PPC::MFOCRF), DestReg).addReg(CRReg); BuildMI(MBB, I, DL, get(PPC::MFOCRF), DestReg).addReg(CRReg);
getKillRegState(KillSrc); getKillRegState(KillSrc);
// Rotate the CR bit in the CR fields to be the least significant bit and // Rotate the CR bit in the CR fields to be the least significant bit and

View File

@ -280,7 +280,7 @@ public:
unsigned FalseReg) const override; unsigned FalseReg) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,

View File

@ -84,8 +84,8 @@ unsigned RISCVInstrInfo::isStoreToStackSlot(const MachineInstr &MI,
void RISCVInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void RISCVInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI, MachineBasicBlock::iterator MBBI,
const DebugLoc &DL, unsigned DstReg, const DebugLoc &DL, MCRegister DstReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
if (RISCV::GPRRegClass.contains(DstReg, SrcReg)) { if (RISCV::GPRRegClass.contains(DstReg, SrcReg)) {
BuildMI(MBB, MBBI, DL, get(RISCV::ADDI), DstReg) BuildMI(MBB, MBBI, DL, get(RISCV::ADDI), DstReg)
.addReg(SrcReg, getKillRegState(KillSrc)) .addReg(SrcReg, getKillRegState(KillSrc))

View File

@ -34,7 +34,7 @@ public:
int &FrameIndex) const override; int &FrameIndex) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
const DebugLoc &DL, unsigned DstReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DstReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,

View File

@ -304,8 +304,8 @@ bool SparcInstrInfo::reverseBranchCondition(
void SparcInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void SparcInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
unsigned numSubRegs = 0; unsigned numSubRegs = 0;
unsigned movOpc = 0; unsigned movOpc = 0;
const unsigned *subRegIdx = nullptr; const unsigned *subRegIdx = nullptr;

View File

@ -81,7 +81,7 @@ public:
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override; reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,

View File

@ -765,8 +765,8 @@ bool SystemZInstrInfo::PredicateInstruction(
void SystemZInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void SystemZInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI, MachineBasicBlock::iterator MBBI,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
// Split 128-bit GPR moves into two 64-bit moves. Add implicit uses of the // Split 128-bit GPR moves into two 64-bit moves. Add implicit uses of the
// super register in case one of the subregs is undefined. // super register in case one of the subregs is undefined.
// This handles ADDR128 too. // This handles ADDR128 too.
@ -791,10 +791,10 @@ void SystemZInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
// Move 128-bit floating-point values between VR128 and FP128. // Move 128-bit floating-point values between VR128 and FP128.
if (SystemZ::VR128BitRegClass.contains(DestReg) && if (SystemZ::VR128BitRegClass.contains(DestReg) &&
SystemZ::FP128BitRegClass.contains(SrcReg)) { SystemZ::FP128BitRegClass.contains(SrcReg)) {
unsigned SrcRegHi = MCRegister SrcRegHi =
RI.getMatchingSuperReg(RI.getSubReg(SrcReg, SystemZ::subreg_h64), RI.getMatchingSuperReg(RI.getSubReg(SrcReg, SystemZ::subreg_h64),
SystemZ::subreg_h64, &SystemZ::VR128BitRegClass); SystemZ::subreg_h64, &SystemZ::VR128BitRegClass);
unsigned SrcRegLo = MCRegister SrcRegLo =
RI.getMatchingSuperReg(RI.getSubReg(SrcReg, SystemZ::subreg_l64), RI.getMatchingSuperReg(RI.getSubReg(SrcReg, SystemZ::subreg_l64),
SystemZ::subreg_h64, &SystemZ::VR128BitRegClass); SystemZ::subreg_h64, &SystemZ::VR128BitRegClass);
@ -805,10 +805,10 @@ void SystemZInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
} }
if (SystemZ::FP128BitRegClass.contains(DestReg) && if (SystemZ::FP128BitRegClass.contains(DestReg) &&
SystemZ::VR128BitRegClass.contains(SrcReg)) { SystemZ::VR128BitRegClass.contains(SrcReg)) {
unsigned DestRegHi = MCRegister DestRegHi =
RI.getMatchingSuperReg(RI.getSubReg(DestReg, SystemZ::subreg_h64), RI.getMatchingSuperReg(RI.getSubReg(DestReg, SystemZ::subreg_h64),
SystemZ::subreg_h64, &SystemZ::VR128BitRegClass); SystemZ::subreg_h64, &SystemZ::VR128BitRegClass);
unsigned DestRegLo = MCRegister DestRegLo =
RI.getMatchingSuperReg(RI.getSubReg(DestReg, SystemZ::subreg_l64), RI.getMatchingSuperReg(RI.getSubReg(DestReg, SystemZ::subreg_l64),
SystemZ::subreg_h64, &SystemZ::VR128BitRegClass); SystemZ::subreg_h64, &SystemZ::VR128BitRegClass);

View File

@ -242,7 +242,7 @@ public:
bool PredicateInstruction(MachineInstr &MI, bool PredicateInstruction(MachineInstr &MI,
ArrayRef<MachineOperand> Pred) const override; ArrayRef<MachineOperand> Pred) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI, MachineBasicBlock::iterator MBBI,

View File

@ -54,8 +54,8 @@ bool WebAssemblyInstrInfo::isReallyTriviallyReMaterializable(
void WebAssemblyInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void WebAssemblyInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
// This method is called by post-RA expansion, which expects only pregs to // This method is called by post-RA expansion, which expects only pregs to
// exist. However we need to handle both here. // exist. However we need to handle both here.
auto &MRI = MBB.getParent()->getRegInfo(); auto &MRI = MBB.getParent()->getRegInfo();

View File

@ -46,7 +46,7 @@ public:
AAResults *AA) const override; AAResults *AA) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
MachineInstr *commuteInstructionImpl(MachineInstr &MI, bool NewMI, MachineInstr *commuteInstructionImpl(MachineInstr &MI, bool NewMI,
unsigned OpIdx1, unsigned OpIdx1,

View File

@ -2963,8 +2963,8 @@ static unsigned CopyToFromAsymmetricReg(unsigned DestReg, unsigned SrcReg,
void X86InstrInfo::copyPhysReg(MachineBasicBlock &MBB, void X86InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
// First deal with the normal symmetric copies. // First deal with the normal symmetric copies.
bool HasAVX = Subtarget.hasAVX(); bool HasAVX = Subtarget.hasAVX();
bool HasVLX = Subtarget.hasVLX(); bool HasVLX = Subtarget.hasVLX();

View File

@ -312,7 +312,7 @@ public:
ArrayRef<MachineOperand> Cond, unsigned TrueReg, ArrayRef<MachineOperand> Cond, unsigned TrueReg,
unsigned FalseReg) const override; unsigned FalseReg) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, unsigned SrcReg, MachineBasicBlock::iterator MI, unsigned SrcReg,

View File

@ -330,8 +330,8 @@ XCoreInstrInfo::removeBranch(MachineBasicBlock &MBB, int *BytesRemoved) const {
void XCoreInstrInfo::copyPhysReg(MachineBasicBlock &MBB, void XCoreInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, const DebugLoc &DL, MCRegister DestReg,
unsigned SrcReg, bool KillSrc) const { MCRegister SrcReg, bool KillSrc) const {
bool GRDest = XCore::GRRegsRegClass.contains(DestReg); bool GRDest = XCore::GRRegsRegClass.contains(DestReg);
bool GRSrc = XCore::GRRegsRegClass.contains(SrcReg); bool GRSrc = XCore::GRRegsRegClass.contains(SrcReg);

View File

@ -63,7 +63,7 @@ public:
int *BytesRemoved = nullptr) const override; int *BytesRemoved = nullptr) const override;
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
bool KillSrc) const override; bool KillSrc) const override;
void storeRegToStackSlot(MachineBasicBlock &MBB, void storeRegToStackSlot(MachineBasicBlock &MBB,