From: James Molloy Date: Fri, 4 Oct 2019 17:15:25 +0000 (+0000) Subject: [ModuloSchedule] Do not remap terminators X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30ea191e05a69f58bcaf9ccb1ff16e70bbd987d4;p=llvm [ModuloSchedule] Do not remap terminators This is a trivial point fix. Terminator instructions aren't scheduled, so we shouldn't expect to be able to remap them. This doesn't affect Hexagon and PPC because their terminators are always hardware loop backbranches that have no register operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373762 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/ModuloSchedule.cpp b/lib/CodeGen/ModuloSchedule.cpp index d891d644664..7ce3c586180 100644 --- a/lib/CodeGen/ModuloSchedule.cpp +++ b/lib/CodeGen/ModuloSchedule.cpp @@ -1314,7 +1314,7 @@ void KernelRewriter::rewrite() { // Now remap every instruction in the loop. for (MachineInstr &MI : *BB) { - if (MI.isPHI()) + if (MI.isPHI() || MI.isTerminator()) continue; for (MachineOperand &MO : MI.uses()) { if (!MO.isReg() || MO.getReg().isPhysical() || MO.isImplicit())