OSDN Git Service

[Pipeliner] Improve serialization order for post-increments
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 11 Oct 2017 15:51:44 +0000 (15:51 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 11 Oct 2017 15:51:44 +0000 (15:51 +0000)
commit9f806a04386a6ec08cc976286b9bf998438fc803
tree1d244908c7d1e4440f6a5d2d0a86a97b3ecf3131
parent143ffebf675fe0d90b55d2226c6f690fc4b7ed4b
[Pipeliner] Improve serialization order for post-increments

The pipeliner is generating a serial sequence that causes poor
register allocation when a post-increment instruction appears
prior to the use of the post-increment register. This occurs when
there is a circular set of dependences involved with a sequence
of instructions in the same cycle. In this case, there is no
serialization of the parallel semantics that will not cause an
additional register to be allocated.

This patch fixes the problem by changing the instructions so that
the post-increment instruction is used by the subsequent
instruction, which enables the register allocator to make a
better decision and not require another register.

Patch by Brendon Cahoon.

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