[all-commits] [llvm/llvm-project] 3fa651: [CodeGen][AArch64][SVE] Fold [rdffr, ptest] => rdf...

Peter Waller via All-commits all-commits at lists.llvm.org
Wed May 12 07:07:08 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3fa6510f6ea0101c70592487074957bb1cde576c
      https://github.com/llvm/llvm-project/commit/3fa6510f6ea0101c70592487074957bb1cde576c
  Author: Peter Waller <peter.waller at arm.com>
  Date:   2021-05-12 (Wed, 12 May 2021)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    A llvm/test/CodeGen/AArch64/sve-ptest-removal-rdffr.mir

  Log Message:
  -----------
  [CodeGen][AArch64][SVE] Fold [rdffr, ptest] => rdffrs; bugfix for optimizePTestInstr

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

Additionally, check that nothing consumes flags between rdffr and ptest;
this case appears to have been missed previously.

* There is no unpredicated RDFFRS instruction.
* 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.

RDFFR_P to follow in later patch.

Differential Revision: https://reviews.llvm.org/D101357




More information about the All-commits mailing list