[PATCH] D91207: [AArch64][GlobalISel] Select arith extended add/sub in manual selection code

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 14:19:16 PST 2020


paquette created this revision.
paquette added a reviewer: aemerson.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls, rovka.
Herald added a project: LLVM.
paquette requested review of this revision.

The manual selection code for add/sub was not checking if it was possible to fold in shifts + extends (the *rx opcode variants).

As a result, we could never select things like

  cmp x1, w0, uxtw #2

Because we don't import any patterns for compares.

This adds support for the arithmetic shifted register forms and updates tests for instructions selected using `emitADD`, `emitADDS`, and `emitSUBS`.

This is a 0.1% geomean code size improvement on SPECINT2000 at -Os.


https://reviews.llvm.org/D91207

Files:
  llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/opt-fold-compare.mir
  llvm/test/CodeGen/AArch64/GlobalISel/select-cmp.mir
  llvm/test/CodeGen/AArch64/GlobalISel/select-ptr-add.mir
  llvm/test/CodeGen/AArch64/GlobalISel/select-uaddo.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91207.304328.patch
Type: text/x-patch
Size: 11505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201110/a0b3b7f1/attachment.bin>


More information about the llvm-commits mailing list