[PATCH] D102330: [CodeGen][AArch64][SVE] Fold [rdffr, ptest] => rdffrs for RDFFR_P

Peter Waller via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 08:05:47 PDT 2021


peterwaller-arm created this revision.
peterwaller-arm added reviewers: paulwalker-arm, bsmith, joechrisellis, david-arm, sdesmalen, dmgreen.
Herald added subscribers: psnobl, hiraditya, kristof.beyls, tschuett.
Herald added a reviewer: efriedma.
peterwaller-arm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Follow up to D101357 <https://reviews.llvm.org/D101357> / 3fa6510f6 <https://reviews.llvm.org/rG3fa6510f6ea0101c70592487074957bb1cde576c>.

Use flags setting rdffrs instead of rddfr.

RDFFR_P has to be handled differently from the other optimizations in
optimizePTestInstr: It requires introducing an additional operand, since
there is no RDFFRS_P, only RDFFRS_PP. In order to use a flag setting
version, we need to move the mask operand from the PTest into the
flags-setting instruction.

The mask therefore needs to be defined before the RDFFR. If it is not,
bail out for now, which seems to be sufficient for typical code where
this is encountered. This could be extended to move the definition of
the mask up so long as there are no other users.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102330

Files:
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/test/CodeGen/AArch64/sve-ptest-removal-rdffr.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102330.344828.patch
Type: text/x-patch
Size: 3540 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210512/5132f115/attachment.bin>


More information about the llvm-commits mailing list