OSDN Git Service

[Hexagon] Don't ignore mult-cycle latency information
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Tue, 2 May 2017 18:12:19 +0000 (18:12 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Tue, 2 May 2017 18:12:19 +0000 (18:12 +0000)
commit32526ea5c1a9eddf66fa00dc15f58e5a693ae218
tree9b50febcd3f57248b8e8ff9cef9af35d20e492b6
parent033d5060aaa35fd6e3e871a1f240fc15f58d5d48
[Hexagon] Don't ignore mult-cycle latency information

The compiler was generating code that ends up ignoring a multiple
latency dependence between two instructions by scheduling the
intructions in back-to-back packets.

The packetizer needs to end a packet if the latency of the current
current insruction and the source in the previous packet is
greater than 1 cycle. This case occurs when there is still room in
the current packet, but scheduling the instruction causes a stall.
Instead, the packetizer should start a new packet. Also, if the
current packet already contains a stall, then it is okay to add
another instruction to the packet that also causes a stall. This
occurs when there are no instructions that can be scheduled in
between the producer and consumer instructions.

This patch changes the latency for loads to 2 cycles from 3 cycles.
This change refects that a load only needs to be separated by
one extra packet to eliminate the stall.

Patch by Ikhlas Ajbar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301954 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Hexagon/HexagonInstrInfo.cpp
lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
lib/Target/Hexagon/HexagonVLIWPacketizer.h
test/CodeGen/Hexagon/multi-cycle.ll [new file with mode: 0644]