diff options
author | Thomas Raoux <thomasraoux@google.com> | 2019-11-06 11:57:05 -0800 |
---|---|---|
committer | Thomas Raoux <thomasraoux@google.com> | 2019-11-11 09:35:39 -0800 |
commit | 03da6e8c00de2320e6b9dacba8f7850faceae319 (patch) | |
tree | 429653a7ccabdb3657fa7ec35c0b3a1f2d4b957c /llvm/lib/CodeGen/ModuloSchedule.cpp | |
parent | 19bbdf6ca6be5315b2ab88e9d930463ab65c278d (diff) | |
download | llvm-03da6e8c00de2320e6b9dacba8f7850faceae319.zip llvm-03da6e8c00de2320e6b9dacba8f7850faceae319.tar.gz llvm-03da6e8c00de2320e6b9dacba8f7850faceae319.tar.bz2 |
[ModuloSchedule] Do target loop analysis before peeling.
Simple change to call target hook analyzeLoopForPipelining before
changing the loop. After peeling analyzing the loop may be more
complicated for target that don't have a loop instruction. This doesn't
affect Hexagone and PPC as they have hardware loop instructions.
Differential Revision: https://reviews.llvm.org/D69912
Diffstat (limited to 'llvm/lib/CodeGen/ModuloSchedule.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ModuloSchedule.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/ModuloSchedule.cpp b/llvm/lib/CodeGen/ModuloSchedule.cpp index 7ce3c58..98de081 100644 --- a/llvm/lib/CodeGen/ModuloSchedule.cpp +++ b/llvm/lib/CodeGen/ModuloSchedule.cpp @@ -1759,10 +1759,6 @@ void PeelingModuloScheduleExpander::rewriteUsesOf(MachineInstr *MI) { } void PeelingModuloScheduleExpander::fixupBranches() { - std::unique_ptr<TargetInstrInfo::PipelinerLoopInfo> Info = - TII->analyzeLoopForPipelining(BB); - assert(Info); - // Work outwards from the kernel. bool KernelDisposed = false; int TC = Schedule.getNumStages() - 1; @@ -1818,6 +1814,8 @@ void PeelingModuloScheduleExpander::expand() { BB = Schedule.getLoop()->getTopBlock(); Preheader = Schedule.getLoop()->getLoopPreheader(); LLVM_DEBUG(Schedule.dump()); + Info = TII->analyzeLoopForPipelining(BB); + assert(Info); rewriteKernel(); peelPrologAndEpilogs(); |