mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Let RegisterInfo decide whether it can emit cross-class copy or not
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75955 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3e980b4f11
commit
d519756203
@ -132,10 +132,11 @@ bool LowerSubregsInstructionPass::LowerExtract(MachineInstr *MI) {
|
||||
}
|
||||
} else {
|
||||
// Insert copy
|
||||
const TargetRegisterClass *TRC = TRI.getPhysicalRegisterRegClass(DstReg);
|
||||
assert(TRC == TRI.getPhysicalRegisterRegClass(SrcReg) &&
|
||||
"Extract subreg and Dst must be of same register class");
|
||||
TII.copyRegToReg(*MBB, MI, DstReg, SrcReg, TRC, TRC);
|
||||
const TargetRegisterClass *TRCS = TRI.getPhysicalRegisterRegClass(DstReg);
|
||||
const TargetRegisterClass *TRCD = TRI.getPhysicalRegisterRegClass(SrcReg);
|
||||
bool Emitted = TII.copyRegToReg(*MBB, MI, DstReg, SrcReg, TRCD, TRCS);
|
||||
(void)Emitted;
|
||||
assert(Emitted && "Subreg and Dst must be of compatible register class");
|
||||
// Transfer the kill/dead flags, if needed.
|
||||
if (MI->getOperand(0).isDead())
|
||||
TransferDeadFlag(MI, DstReg, TRI);
|
||||
|
Loading…
x
Reference in New Issue
Block a user