mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
Remove TargetInstrInfo::copyRegToReg entirely.
Targets must now implement TargetInstrInfo::copyPhysReg instead. There is no longer a default implementation forwarding to copyRegToReg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108095 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1310,7 +1310,8 @@ implementation in <tt>SparcInstrInfo.cpp</tt>:
|
|||||||
a direct store to a stack slot, return the register number of the
|
a direct store to a stack slot, return the register number of the
|
||||||
destination and the <tt>FrameIndex</tt> of the stack slot.</li>
|
destination and the <tt>FrameIndex</tt> of the stack slot.</li>
|
||||||
|
|
||||||
<li><tt>copyRegToReg</tt> — Copy values between a pair of registers.</li>
|
<li><tt>copyPhysReg</tt> — Copy values between a pair of physical
|
||||||
|
registers.</li>
|
||||||
|
|
||||||
<li><tt>storeRegToStackSlot</tt> — Store a register value to a stack
|
<li><tt>storeRegToStackSlot</tt> — Store a register value to a stack
|
||||||
slot.</li>
|
slot.</li>
|
||||||
|
@@ -357,7 +357,9 @@ public:
|
|||||||
virtual void copyPhysReg(MachineBasicBlock &MBB,
|
virtual void copyPhysReg(MachineBasicBlock &MBB,
|
||||||
MachineBasicBlock::iterator MI, DebugLoc DL,
|
MachineBasicBlock::iterator MI, DebugLoc DL,
|
||||||
unsigned DestReg, unsigned SrcReg,
|
unsigned DestReg, unsigned SrcReg,
|
||||||
bool KillSrc) const =0;
|
bool KillSrc) const {
|
||||||
|
assert(0 && "Target didn't implement TargetInstrInfo::copyPhysReg!");
|
||||||
|
}
|
||||||
|
|
||||||
/// storeRegToStackSlot - Store the specified register of the given register
|
/// storeRegToStackSlot - Store the specified register of the given register
|
||||||
/// class to the specified stack frame index. The store instruction is to be
|
/// class to the specified stack frame index. The store instruction is to be
|
||||||
@@ -648,22 +650,6 @@ public:
|
|||||||
|
|
||||||
virtual ScheduleHazardRecognizer *
|
virtual ScheduleHazardRecognizer *
|
||||||
CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const;
|
CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const;
|
||||||
virtual void copyPhysReg(MachineBasicBlock &MBB,
|
|
||||||
MachineBasicBlock::iterator MI, DebugLoc DL,
|
|
||||||
unsigned DestReg, unsigned SrcReg,
|
|
||||||
bool KillSrc) const;
|
|
||||||
/// copyRegToReg - Legacy hook going away soon. Targets should implement
|
|
||||||
/// copyPhysReg instead.
|
|
||||||
virtual bool copyRegToReg(MachineBasicBlock &MBB,
|
|
||||||
MachineBasicBlock::iterator MI,
|
|
||||||
unsigned DestReg, unsigned SrcReg,
|
|
||||||
const TargetRegisterClass *DestRC,
|
|
||||||
const TargetRegisterClass *SrcRC,
|
|
||||||
DebugLoc DL) const {
|
|
||||||
assert(0 && "Target didn't implement TargetInstrInfo::copyPhysReg!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
@@ -62,8 +62,7 @@ namespace TargetOpcode {
|
|||||||
/// used between instruction selection and MachineInstr creation, before
|
/// used between instruction selection and MachineInstr creation, before
|
||||||
/// virtual registers have been created for all the instructions, and it's
|
/// virtual registers have been created for all the instructions, and it's
|
||||||
/// only needed in cases where the register classes implied by the
|
/// only needed in cases where the register classes implied by the
|
||||||
/// instructions are insufficient. The actual MachineInstrs to perform
|
/// instructions are insufficient. It is emitted as a COPY MachineInstr.
|
||||||
/// the copy are emitted with the TargetInstrInfo::copyRegToReg hook.
|
|
||||||
COPY_TO_REGCLASS = 10,
|
COPY_TO_REGCLASS = 10,
|
||||||
|
|
||||||
/// DBG_VALUE - a mapping of the llvm.dbg.value intrinsic
|
/// DBG_VALUE - a mapping of the llvm.dbg.value intrinsic
|
||||||
|
@@ -438,20 +438,3 @@ ScheduleHazardRecognizer *TargetInstrInfoImpl::
|
|||||||
CreateTargetPostRAHazardRecognizer(const InstrItineraryData &II) const {
|
CreateTargetPostRAHazardRecognizer(const InstrItineraryData &II) const {
|
||||||
return (ScheduleHazardRecognizer *)new PostRAHazardRecognizer(II);
|
return (ScheduleHazardRecognizer *)new PostRAHazardRecognizer(II);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default implementation of copyPhysReg using copyRegToReg.
|
|
||||||
void TargetInstrInfoImpl::copyPhysReg(MachineBasicBlock &MBB,
|
|
||||||
MachineBasicBlock::iterator MI,
|
|
||||||
DebugLoc DL,
|
|
||||||
unsigned DestReg, unsigned SrcReg,
|
|
||||||
bool KillSrc) const {
|
|
||||||
assert(TargetRegisterInfo::isPhysicalRegister(DestReg));
|
|
||||||
assert(TargetRegisterInfo::isPhysicalRegister(SrcReg));
|
|
||||||
const TargetRegisterInfo *TRI = MBB.getParent()->getTarget().getRegisterInfo();
|
|
||||||
const TargetRegisterClass *DRC = TRI->getPhysicalRegisterRegClass(DestReg);
|
|
||||||
const TargetRegisterClass *SRC = TRI->getPhysicalRegisterRegClass(SrcReg);
|
|
||||||
if (!copyRegToReg(MBB, MI, DestReg, SrcReg, DRC, SRC, DL))
|
|
||||||
llvm_unreachable("Cannot emit physreg copy instruction");
|
|
||||||
if (KillSrc)
|
|
||||||
llvm::prior(MI)->addRegisterKilled(SrcReg, TRI, true);
|
|
||||||
}
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
; RUN: llc < %s -march=bfin
|
; RUN: llc < %s -march=bfin
|
||||||
|
|
||||||
; This test tries to use a JustCC register as a data operand for MOVEcc. It
|
; This test tries to use a JustCC register as a data operand for MOVEcc. It
|
||||||
; calls copyRegToReg(JustCC -> DP), failing because JustCC can only be copied to
|
; copies (JustCC -> DP), failing because JustCC can only be copied to D.
|
||||||
; D. The proper solution would be to restrict the virtual register to D only.
|
; The proper solution would be to restrict the virtual register to D only.
|
||||||
|
|
||||||
define i32 @main() {
|
define i32 @main() {
|
||||||
entry:
|
entry:
|
||||||
|
@@ -83,8 +83,7 @@ class Inst<dag opnds, string asmstr, bits<8> opcode,
|
|||||||
// the pattern.
|
// the pattern.
|
||||||
// 6. Address expressions should become first-class entities.
|
// 6. Address expressions should become first-class entities.
|
||||||
|
|
||||||
// Simple copy instruction. isMoveInstr could easily be inferred from this,
|
// Simple copy instruction.
|
||||||
// as could TargetRegisterInfo::copyRegToReg.
|
|
||||||
def MOV8rr : Inst<(ops R8:$dst, R8:$src),
|
def MOV8rr : Inst<(ops R8:$dst, R8:$src),
|
||||||
"mov $dst, $src", 0x88, MRMDestReg,
|
"mov $dst, $src", 0x88, MRMDestReg,
|
||||||
[(set R8:$dst, R8:$src)]>;
|
[(set R8:$dst, R8:$src)]>;
|
||||||
|
Reference in New Issue
Block a user