[PATCH] D48832: [ARM] ARMCodeGenPrepare backend pass

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 2 08:06:50 PDT 2018


samparker created this revision.
samparker added reviewers: SjoerdMeijer, john.brawn, dmgreen, efriedma, rengolin, t.p.northover.
Herald added subscribers: chrib, kristof.beyls, mgorny.
Herald added a reviewer: javed.absar.

Arm specific codegen prepare is implemented to perform type promotion
on icmp operands, which can enable the removal of uxtb and uxth
(unsigned extend) instructions. This is possible because performing
type promotion before ISel alleviates this duty from the DAG builder,
which has to perform legalisation, but has a limited view on data
ranges.

      

The pass visits any instruction operand of an icmp and creates a
 worklist to traverse the use-def tree to determine whether the values
 can simply be promoted. Our concern is values in the registers
 overflowing the narrow (i8, i16) data range, so instructions marked
 with nuw can be promoted easily. For add and sub instructions, we are
 able to use the parallel dsp instructions to operate on scalar data
 types and avoid overflowing bits. Underflowing adds and subs are also
 permitted when the result is only used by an unsigned icmp.


https://reviews.llvm.org/D48832

Files:
  lib/Target/ARM/ARM.h
  lib/Target/ARM/ARMCodeGenPrepare.cpp
  lib/Target/ARM/ARMTargetMachine.cpp
  lib/Target/ARM/CMakeLists.txt
  test/CodeGen/ARM/arm-cgp-icmps.ll
  test/CodeGen/ARM/arm-cgp-phis-calls-ret.ll
  test/CodeGen/ARM/arm-cgp-signed.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48832.153719.patch
Type: text/x-patch
Size: 39282 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180702/3de2d7c2/attachment.bin>


More information about the llvm-commits mailing list