[PATCH] D30294: [ARM] LSL #0 is an alias of MOV

John Brawn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 03:56:38 PST 2017


john.brawn created this revision.
Herald added a subscriber: aemerson.

Currently we handle this correctly in arm, but in thumb we don't which leads to an unpredictable instruction being emitted for LSL #0 in an IT block and SP not being permitted in some cases when it should be.

For the thumb2 LSL we can handle this by making LSL #0 an alias of MOV in the .td file, but for thumb1 we need to handle it in checkTargetMatchPredicate to get the IT handling right. We also need to adjust the handling of MOV rd, rn, LSL #0 to avoid generating the 16-bit encoding in an IT block. We should also adjust it to allow SP in the same way that it is allowed in MOV rd, rn, but I haven't done that here because it looks like it would take quite a lot of work to get right.

Additionally correct the selection of the 16-bit shift instructions in processInstruction, where it was checking if the two registers were equal when it should have been checking if they were low. It appears that previously this code was never executed and the 16-bit encoding was selected by default, but the other changes I've done here have somehow made it start being used.


Repository:
  rL LLVM

https://reviews.llvm.org/D30294

Files:
  lib/Target/ARM/ARMInstrThumb2.td
  lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  test/MC/ARM/basic-thumb2-instructions.s
  test/MC/ARM/lsl-zero.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30294.89494.patch
Type: text/x-patch
Size: 14502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170223/9c86fe4f/attachment.bin>


More information about the llvm-commits mailing list