mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-24 08:33:39 +00:00
Make sure reload of implicit uses are issued before remat's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5f2e4681ce
commit
b2fd65f936
@ -1040,7 +1040,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) {
|
|||||||
/// ReusedOperands - Keep track of operand reuse in case we need to undo
|
/// ReusedOperands - Keep track of operand reuse in case we need to undo
|
||||||
/// reuse.
|
/// reuse.
|
||||||
ReuseInfo ReusedOperands(MI, TRI);
|
ReuseInfo ReusedOperands(MI, TRI);
|
||||||
// Process all of the spilled uses and all non spilled reg references.
|
SmallVector<unsigned, 4> VirtUseOps;
|
||||||
for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
|
||||||
MachineOperand &MO = MI.getOperand(i);
|
MachineOperand &MO = MI.getOperand(i);
|
||||||
if (!MO.isRegister() || MO.getReg() == 0)
|
if (!MO.isRegister() || MO.getReg() == 0)
|
||||||
@ -1053,9 +1053,21 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) {
|
|||||||
RegInfo->setPhysRegUsed(VirtReg);
|
RegInfo->setPhysRegUsed(VirtReg);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We want to process implicit virtual register uses first.
|
||||||
|
if (MO.isImplicit())
|
||||||
|
VirtUseOps.insert(VirtUseOps.begin(), i);
|
||||||
|
else
|
||||||
|
VirtUseOps.push_back(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process all of the spilled uses and all non spilled reg references.
|
||||||
|
for (unsigned j = 0, e = VirtUseOps.size(); j != e; ++j) {
|
||||||
|
unsigned i = VirtUseOps[j];
|
||||||
|
MachineOperand &MO = MI.getOperand(i);
|
||||||
|
unsigned VirtReg = MO.getReg();
|
||||||
assert(TargetRegisterInfo::isVirtualRegister(VirtReg) &&
|
assert(TargetRegisterInfo::isVirtualRegister(VirtReg) &&
|
||||||
"Not a virtual or a physical register?");
|
"Not a virtual register?");
|
||||||
|
|
||||||
unsigned SubIdx = MO.getSubReg();
|
unsigned SubIdx = MO.getSubReg();
|
||||||
if (VRM.isAssignedReg(VirtReg)) {
|
if (VRM.isAssignedReg(VirtReg)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user