[PATCH] D64084: [AArch64][GlobalISel] Teach tryOptSelect to handle G_ICMP

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 09:38:54 PDT 2019


paquette created this revision.
paquette added a reviewer: aemerson.
Herald added subscribers: Petar.Avramovic, hiraditya, kristof.beyls, javed.absar, rovka.
Herald added a project: LLVM.

This teaches `tryOptSelect` to handle folding G_ICMP, and removes the requirement that the G_SELECT we're dealing with is floating point.

Some refactoring to make this work nicely as well:

- Factor out the scalar case from the selection code for G_ICMP into `emitIntegerCompare`.
- Make `tryOptCMN` return a MachineInstr* instead of a bool.
- Make `tryOptCMN` not modify the instruction being selected.
- Factor out the CMN emission into `emitCMN` for readability.

By doing this this way, we can get all of the compare selection optimizations in select emission.


https://reviews.llvm.org/D64084

Files:
  llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/fold-fp-select.mir
  llvm/test/CodeGen/AArch64/GlobalISel/fold-select.mir
  llvm/test/CodeGen/AArch64/GlobalISel/opt-fold-cmn.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64084.207579.patch
Type: text/x-patch
Size: 21081 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190702/a769bfab/attachment.bin>


More information about the llvm-commits mailing list