From 30ea191e05a69f58bcaf9ccb1ff16e70bbd987d4 Mon Sep 17 00:00:00 2001 From: James Molloy Date: Fri, 4 Oct 2019 17:15:25 +0000 Subject: [PATCH] [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 --- lib/CodeGen/ModuloSchedule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()) -- 2.40.0