[PATCH] D79365: [AArch64][GlobalISel] Fold shifts into G_ICMP

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 14:32:23 PDT 2020


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

Since G_ICMP can be selected to a SUBS, we can fold shifts into such compares.

E.g.

  cmp	w1, w0, lsl #3
  cmp	w1, w0, lsr #3
  cmp	w1, w0, asr #3

This is done the same way as for adds and subtracts, using `selectShiftedRegister`.

This gives some minor code size savings on CTMark.


https://reviews.llvm.org/D79365

Files:
  llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/opt-shifted-reg-compare.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79365.261926.patch
Type: text/x-patch
Size: 26926 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200504/0e9a6da9/attachment.bin>


More information about the llvm-commits mailing list