]> granicus.if.org Git - llvm/commit
[Hexagon] Minimize number of repeated constant extenders
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 13 Oct 2017 19:02:59 +0000 (19:02 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Fri, 13 Oct 2017 19:02:59 +0000 (19:02 +0000)
commit59d5964ec6f0d455bc8f72d8a71ff09656e00276
tree84de1f8798bba9180361d1d9bdd486432f12f436
parent04312950d0c8191808ef2fef7476edd8f927c8c9
[Hexagon] Minimize number of repeated constant extenders

Each constant extender requires an extra instruction, which adds to the
code size and also reduces the number of available slots in an instruction
packet. In most cases, the value of a repeated constant extender could be
loaded into a register, and the instructions using the extender could be
replaced with their counterparts that use that register instead.

This patch adds a pass that tries to reduce the number of constant
extenders, including extenders which differ only in an immediate offset
known at compile time, e.g. @global and @global+12.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315735 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Hexagon/CMakeLists.txt
lib/Target/Hexagon/HexagonConstExtenders.cpp [new file with mode: 0644]
lib/Target/Hexagon/HexagonTargetMachine.cpp
test/CodeGen/Hexagon/cext-opt-basic.mir [new file with mode: 0644]
test/CodeGen/Hexagon/zextloadi1.ll