OSDN Git Service

[ARC] Better classify add/sub immediate instructions in frame lowering.
authorPete Couperus <petecoup@synopsys.com>
Thu, 14 Mar 2019 17:50:46 +0000 (17:50 +0000)
committerPete Couperus <petecoup@synopsys.com>
Thu, 14 Mar 2019 17:50:46 +0000 (17:50 +0000)
commit4385104c44f7189db633f82379f596dae90ff6e9
tree91e9432b3fcc4a3a3d0686606e2657c9b0405a8a
parent3384c56bc0a6b2982282f8850af6c232ec98135e
[ARC] Better classify add/sub immediate instructions in frame lowering.

Summary:
Some operations have multiple ARC instructions that are applicable.
For instance, "add r0, r0, 123" can be encoded as a "LImm" instruction
with a 32-bit immediate (8-bytes), or as a signed 12-bit immediate instruction
for the case where the source and destination register are the same (4-bytes).
The ARC assembler will choose the shortest encoding, but we should track
the correct instruction in the compiler.
This patch fixes the instruction used in some cases from ARCFrameLowering.

Subscribers: hiraditya, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356179 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARC/ARCFrameLowering.cpp