[PATCH] D111088: [AArch64][GlobalISel] Fold 64-bit cmps with 64-bit adds

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 4 12:09:11 PDT 2021


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

G_ICMP is selected to an arithmetic overflow op (ADDS/SUBS/etc) with a dead destination + a CSINC instruction.

We have a fold which allows us to combine 32-bit adds with G_ICMP.

The problem with G_ICMP is that we model it as always having a 32-bit destination even though it can be a 64-bit operation. So, we were missing some opportunities for 64-bit folds.

This patch teaches the fold to recognize 64-bit G_ICMPs + refactors some of the code surrounding CSINC accordingly.

(Later down the line, I think we should probably change the way we handle G_ICMP in general.)


https://reviews.llvm.org/D111088

Files:
  llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/select-cmp.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111088.376984.patch
Type: text/x-patch
Size: 25939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211004/16173e37/attachment.bin>


More information about the llvm-commits mailing list