mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
Add in some things I forgot, which Chris helpfully reminded me of...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12735 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
59e04e4889
commit
0f51cc1759
@ -63,14 +63,18 @@ static bool hasDelaySlot (unsigned Opcode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// runOnMachineBasicBlock - Fill in delay slots for the given basic block.
|
/// runOnMachineBasicBlock - Fill in delay slots for the given basic block.
|
||||||
|
/// Currently, we fill delay slots with NOPs. We assume there is only one
|
||||||
|
/// delay slot per delayed instruction.
|
||||||
///
|
///
|
||||||
bool Filler::runOnMachineBasicBlock (MachineBasicBlock &MBB) {
|
bool Filler::runOnMachineBasicBlock (MachineBasicBlock &MBB) {
|
||||||
|
bool Changed = false;
|
||||||
for (MachineBasicBlock::iterator I = MBB.begin (); I != MBB.end (); ++I)
|
for (MachineBasicBlock::iterator I = MBB.begin (); I != MBB.end (); ++I)
|
||||||
if (hasDelaySlot (I->getOpcode ())) {
|
if (hasDelaySlot (I->getOpcode ())) {
|
||||||
MachineBasicBlock::iterator J = I;
|
MachineBasicBlock::iterator J = I;
|
||||||
++J;
|
++J;
|
||||||
MBB.insert (J, BuildMI (V8::NOP, 0));
|
BuildMI (MBB, J, V8::NOP, 0);
|
||||||
++FilledSlots;
|
++FilledSlots;
|
||||||
|
Changed = true;
|
||||||
}
|
}
|
||||||
return false;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
@ -63,14 +63,18 @@ static bool hasDelaySlot (unsigned Opcode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// runOnMachineBasicBlock - Fill in delay slots for the given basic block.
|
/// runOnMachineBasicBlock - Fill in delay slots for the given basic block.
|
||||||
|
/// Currently, we fill delay slots with NOPs. We assume there is only one
|
||||||
|
/// delay slot per delayed instruction.
|
||||||
///
|
///
|
||||||
bool Filler::runOnMachineBasicBlock (MachineBasicBlock &MBB) {
|
bool Filler::runOnMachineBasicBlock (MachineBasicBlock &MBB) {
|
||||||
|
bool Changed = false;
|
||||||
for (MachineBasicBlock::iterator I = MBB.begin (); I != MBB.end (); ++I)
|
for (MachineBasicBlock::iterator I = MBB.begin (); I != MBB.end (); ++I)
|
||||||
if (hasDelaySlot (I->getOpcode ())) {
|
if (hasDelaySlot (I->getOpcode ())) {
|
||||||
MachineBasicBlock::iterator J = I;
|
MachineBasicBlock::iterator J = I;
|
||||||
++J;
|
++J;
|
||||||
MBB.insert (J, BuildMI (V8::NOP, 0));
|
BuildMI (MBB, J, V8::NOP, 0);
|
||||||
++FilledSlots;
|
++FilledSlots;
|
||||||
|
Changed = true;
|
||||||
}
|
}
|
||||||
return false;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user