[PATCH] D20155: [ARM] PR25722 Support and tests for transform of LDR rt, = to MOV

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 02:57:48 PDT 2016


peter.smith created this revision.
peter.smith added reviewers: rengolin, olista01, t.p.northover.
peter.smith added a subscriber: llvm-commits.
Herald added subscribers: rengolin, aemerson.

This change implements the transformation in processInstruction() for the LDR rt, =expression to MOV rt, expression when the expression can be evaluated and can fit into the immediate field of the MOV or a MVN.

Across the ARM and Thumb instruction sets there are several cases to consider, each with a different range of representatble constants.
In ARM we have:
- Modified immediate (All ARM architectures)
- MOVW (v6t2 and above)
In Thumb we have:
- Modified immediate (v6t2, v7m and v8m.mainline)
- MOVW (v6t2, v7m, v8.mainline and v8m.baseline)
- Narrow Thumb MOV that can be used in an IT block (non flag-setting)

If the immediate fits any of the available alternatives then we make the transformation.

http://reviews.llvm.org/D20155

Files:
  lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  test/MC/ARM/ldr-pseudo-cond-darwin.s
  test/MC/ARM/ldr-pseudo-cond.s
  test/MC/ARM/ldr-pseudo-darwin.s
  test/MC/ARM/ldr-pseudo.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20155.56869.patch
Type: text/x-patch
Size: 15978 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160511/c9882035/attachment.bin>


More information about the llvm-commits mailing list