From 72710af2334849dfaa9419b341617dd457292e7c Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 31 Oct 2021 07:57:34 -0700 Subject: [CodeGen, Target] Use MachineBasicBlock::terminators (NFC) --- llvm/lib/CodeGen/ModuloSchedule.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'llvm/lib/CodeGen/ModuloSchedule.cpp') diff --git a/llvm/lib/CodeGen/ModuloSchedule.cpp b/llvm/lib/CodeGen/ModuloSchedule.cpp index fb133f7..120ecd7 100644 --- a/llvm/lib/CodeGen/ModuloSchedule.cpp +++ b/llvm/lib/CodeGen/ModuloSchedule.cpp @@ -141,13 +141,11 @@ void ModuloScheduleExpander::generatePipelinedLoop() { // Copy any terminator instructions to the new kernel, and update // names as needed. - for (MachineBasicBlock::iterator I = BB->getFirstTerminator(), - E = BB->instr_end(); - I != E; ++I) { - MachineInstr *NewMI = MF.CloneMachineInstr(&*I); + for (MachineInstr &MI : BB->terminators()) { + MachineInstr *NewMI = MF.CloneMachineInstr(&MI); updateInstruction(NewMI, false, MaxStageCount, 0, VRMap); KernelBB->push_back(NewMI); - InstrMap[NewMI] = &*I; + InstrMap[NewMI] = &MI; } NewKernel = KernelBB; -- cgit v1.1