[PATCH] D90774: [AArch64][GlobalISel] Fold G_XOR x, -1 into G_SELECT and select CSINV

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 10:17:17 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.

When we see

  xor = G_XOR xor_lhs, -1
  select = G_SELECT cc, tval, xor

Fold this into

  select = CSINV tval, xor_lhs, cc

Update select-select.mir to reflect the changes.

For now, only handle the case where the G_XOR is the false-value for the G_SELECT. It may make more sense to handle the true-value case in post-legalizer lowering.


https://reviews.llvm.org/D90774

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90774.302890.patch
Type: text/x-patch
Size: 6215 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201104/6d27c6d0/attachment.bin>


More information about the llvm-commits mailing list