Improve handling of stack accesses in Thumb-1
authorRenato Golin <renato.golin@linaro.org>
Wed, 25 Feb 2015 14:41:06 +0000 (14:41 +0000)
committerRenato Golin <renato.golin@linaro.org>
Wed, 25 Feb 2015 14:41:06 +0000 (14:41 +0000)
commitb9887ef32a5d06108dfabbbe181bd8e4ea7abbfe
treee470f2ae641ff070823cdb61580fd2a777e60b22
parenta9b01eb77641cce46dcc69bce27635a72187a89c
Improve handling of stack accesses in Thumb-1

Thumb-1 only allows SP-based LDR and STR to be word-sized, and SP-base LDR,
STR, and ADD only allow offsets that are a multiple of 4. Make some changes
to better make use of these instructions:

* Use word loads for anyext byte and halfword loads from the stack.
* Enforce 4-byte alignment on objects accessed in this way, to ensure that
  the offset is valid.
* Do the same for objects whose frame index is used, in order to avoid having
  to use more than one ADD to generate the frame index.
* Correct how many bits of offset we think AddrModeT1_s has.

Patch by John Brawn.

llvm-svn: 230496
13 files changed:
llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
llvm/lib/Target/ARM/ARMInstrThumb.td
llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
llvm/test/CodeGen/ARM/2015-01-21-thumbv4t-ldstr-opt.ll
llvm/test/CodeGen/ARM/atomic-ops-v8.ll
llvm/test/CodeGen/ARM/debug-frame-vararg.ll
llvm/test/CodeGen/ARM/frame-register.ll
llvm/test/CodeGen/ARM/thumb1-varalloc.ll
llvm/test/CodeGen/ARM/thumb1_return_sequence.ll
llvm/test/CodeGen/Thumb/stack-access.ll [new file with mode: 0644]
llvm/test/CodeGen/Thumb/stm-merge.ll
llvm/test/CodeGen/Thumb/vargs.ll