mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 02:52:53 +02:00
CodeGen: Use MachineInstr& in PostRAHazardRecognizer, NFC
Convert a loop to a range-based for, using MachineInstr& instead of MachineInstr* and removing an implicit conversion from iterator to pointer. llvm-svn: 274311
This commit is contained in:
parent
d414c8259f
commit
0a44b07c9f
@ -79,18 +79,16 @@ bool PostRAHazardRecognizer::runOnMachineFunction(MachineFunction &Fn) {
|
||||
for (auto &MBB : Fn) {
|
||||
// We do not call HazardRec->reset() here to make sure we are handling noop
|
||||
// hazards at the start of basic blocks.
|
||||
for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
|
||||
I != E; ++I) {
|
||||
MachineInstr *MI = I;
|
||||
for (MachineInstr &MI : MBB) {
|
||||
// If we need to emit noops prior to this instruction, then do so.
|
||||
unsigned NumPreNoops = HazardRec->PreEmitNoops(MI);
|
||||
unsigned NumPreNoops = HazardRec->PreEmitNoops(&MI);
|
||||
for (unsigned i = 0; i != NumPreNoops; ++i) {
|
||||
HazardRec->EmitNoop();
|
||||
TII->insertNoop(MBB, I);
|
||||
TII->insertNoop(MBB, MachineBasicBlock::iterator(MI));
|
||||
++NumNoops;
|
||||
}
|
||||
|
||||
HazardRec->EmitInstruction(MI);
|
||||
HazardRec->EmitInstruction(&MI);
|
||||
if (HazardRec->atIssueLimit()) {
|
||||
HazardRec->AdvanceCycle();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user