[Hexagon] Handle instruction latency for 0 or 2 cycles
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 15 Jul 2016 21:34:02 +0000 (21:34 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 15 Jul 2016 21:34:02 +0000 (21:34 +0000)
commit408e300933f2c5e8aaffb2539e47b89a2112b81b
tree00b95df37257660f9185c9ec5aaeb911b450e8bc
parent13fb860c7847d371a6b18dc38e805366bc582e24
[Hexagon] Handle instruction latency for 0 or 2 cycles

The Hexagon schedulers need to handle instructions with a latency
of 0 or 2 more accurately. The problem, in v60, is that a dependence
between two instructions with a 2 cycle latency can use a .cur version
of the source to achieve a 0 cycle latency when the use is in the
same packet. Any othe use, must be at least 2 packets later, or a
stall occurs. In other words, the compiler does not want to schedule
the dependent instructions 1 cycle later.

To achieve this, the latency adjustment code allows only a single
dependence to have a zero latency. All other instructions have the
other value, which is typically 2 cycles. We use a heuristic to
determine which instruction gets the 0 latency.

The Hexagon machine scheduler was also changed to increase the cost
associated with 0 latency dependences than can be scheduled in the
same packet.

Patch by Brendon Cahoon.

llvm-svn: 275625
llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
llvm/lib/Target/Hexagon/HexagonInstrInfo.h
llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp
llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
llvm/lib/Target/Hexagon/HexagonSubtarget.h