[DFAPacketizer] Track resources for packetized instructions
commit333900f76810a28372e047c0d3bd13fbc800c866
authorJames Molloy <jmolloy@google.com>
Fri, 6 Sep 2019 12:20:08 +0000 (6 12:20 +0000)
committerJames Molloy <jmolloy@google.com>
Fri, 6 Sep 2019 12:20:08 +0000 (6 12:20 +0000)
tree4432510a0b463315635931afe810cac2036a8bdc
parent61af04a1322b66db6ab63a9f384ff7ab8c858a23
[DFAPacketizer] Track resources for packetized instructions

This patch allows the DFAPacketizer to be queried after a packet is formed to work out which
resources were allocated to the packetized instructions.

This is particularly important for targets that do their own bundle packing - it's not
sufficient to know simply that instructions can share a packet; which slots are used is
also required for encoding.

This extends the emitter to emit a side-table containing resource usage diffs for each
state transition. The packetizer maintains a set of all possible resource states in its
current state. After packetization is complete, all remaining resource states are
possible packetization strategies.

The sidetable is only ~500K for Hexagon, but the extra tracking is disabled by default
(most uses of the packetizer like MachinePipeliner don't care and don't need the extra
maintained state).

Differential Revision: https://reviews.llvm.org/D66936

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371198 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/DFAPacketizer.h
lib/CodeGen/DFAPacketizer.cpp
lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
test/CodeGen/Hexagon/packetizer-resources.ll [new file with mode: 0644]
utils/TableGen/DFAPacketizerEmitter.cpp