[PATCH] D48170: ARM: use "add" instead of "orr" for code size

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 14 06:34:09 PDT 2018


t.p.northover created this revision.
Herald added subscribers: chrib, hiraditya, kristof.beyls, mcrosier.
Herald added a reviewer: javed.absar.

The implementation here is a bit nasty, but the basic idea is that Thumb has more 16-bit encodings available for ADD than it does for ORR. Combine that with LLVM's (slightly perverse) desire to convert adds to ors as the canonical form and we end up with unnecessary bloat on Thumb targets.

So this patch tries to undo that canonicalization where possible. The implementation is not pretty, but I'm not sure there's a better way.


Repository:
  rL LLVM

https://reviews.llvm.org/D48170

Files:
  llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
  llvm/lib/Target/ARM/ARMInstrThumb.td
  llvm/lib/Target/ARM/ARMInstrThumb2.td
  llvm/test/CodeGen/ARM/shift-combine.ll
  llvm/test/CodeGen/Thumb2/2010-03-15-AsmCCClobber.ll
  llvm/test/CodeGen/Thumb2/thumb2-uxtb.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48170.151341.patch
Type: text/x-patch
Size: 5020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180614/88c301c8/attachment.bin>


More information about the llvm-commits mailing list