diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-03-20 17:03:27 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-03-20 17:03:27 +0000 |
commit | 4c6b65f685d6ae51764f3e8a64f41d44ec40d601 (patch) | |
tree | 9e230abfb20e729ff6cec752f8aadbd89ff039e0 /llvm/lib | |
parent | fb3f509e01b8365e090fd727119125872d0ad85b (diff) | |
download | bcm5719-llvm-4c6b65f685d6ae51764f3e8a64f41d44ec40d601.tar.gz bcm5719-llvm-4c6b65f685d6ae51764f3e8a64f41d44ec40d601.zip |
[Hexagon] Correct the computation of TopReadyCycle and BotReadyCycle of SU
TopReadyCycle and BotReadyCycle were off by one cycle when an SU is either
the first instruction or the last instruction in a packet.
Patch by Ikhlas Ajbar.
llvm-svn: 328000
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp b/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp index ddf9c4cb185..a9e0c8f3918 100644 --- a/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp +++ b/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp @@ -153,9 +153,10 @@ bool VLIWResourceModel::reserveResources(SUnit *SU, bool IsTop) { TotalPackets++; return false; } - // If this SU does not fit in the packet + // If this SU does not fit in the packet or the packet is now full // start a new one. - if (!isResourceAvailable(SU, IsTop)) { + if (!isResourceAvailable(SU, IsTop) || + Packet.size() >= SchedModel->getIssueWidth()) { ResourcesModel->clearResources(); Packet.clear(); TotalPackets++; @@ -189,15 +190,6 @@ bool VLIWResourceModel::reserveResources(SUnit *SU, bool IsTop) { } #endif - // If packet is now full, reset the state so in the next cycle - // we start fresh. - if (Packet.size() >= SchedModel->getIssueWidth()) { - ResourcesModel->clearResources(); - Packet.clear(); - TotalPackets++; - startNewCycle = true; - } - return startNewCycle; } @@ -1100,10 +1092,10 @@ SUnit *ConvergingVLIWScheduler::pickNode(bool &IsTopNode) { /// does. void ConvergingVLIWScheduler::schedNode(SUnit *SU, bool IsTopNode) { if (IsTopNode) { - SU->TopReadyCycle = Top.CurrCycle; Top.bumpNode(SU); + SU->TopReadyCycle = Top.CurrCycle; } else { - SU->BotReadyCycle = Bot.CurrCycle; Bot.bumpNode(SU); + SU->BotReadyCycle = Bot.CurrCycle; } } |