[PATCH] D101357: [CodeGen][AArch64][SVE] Substitute [rdffr, ptest] => rdffrs

Peter Waller via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 05:55:59 PDT 2021


peterwaller-arm created this revision.
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.

When a ptest is used to set flags from the output of rdffr, the ptest
can be eliminated, using a flags-setting rdffrs instead.

- There is no unpredicated RDFFRS instruction.
- RDFFR_P can take the predicate argument of the PTEST into the mask argument of the RDFFRS_PP.
- If substituting RDFFR_PP, require that the mask argument of the PTEST matches that of the RDFFR_PP.
- Move some precondition code up inside optimizePTestInstr, so that it covers the new code paths for RDFFR which return earlier.
  - Only consider RDFFR, PTEST in same basic block.
  - Check for other flag setting instructions between the two, abort if found.
  - Drop an old TODO comment about removing dead PTEST instructions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101357

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: D101357.340811.patch
Type: text/x-patch
Size: 5866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210427/50184ce0/attachment.bin>


More information about the llvm-commits mailing list