[CodeGen][AArch64][SVE] Canonicalize intrinsic rdffr{ => _z}

Authored by peterwaller-arm on May 12 2021, 7:47 AM.


[CodeGen][AArch64][SVE] Canonicalize intrinsic rdffr{ => _z}

Follow up to D101357 / 3fa6510f6.
Supersedes D102330.

Goal: Use flags setting rdffrs instead of rdffr + ptest.

Problem: RDFFR_P doesn't have have a flags setting equivalent.

Solution: in instcombine, canonicalize to RDFFR_PP at the IR level, and
rely on RDFFR_PP+PTEST => RDFFRS_PP optimization in

While here:

  • Test that rdffr.z+ptest generates a rdffrs.
  • Use update_{test,llc}_checks.py on the tests.
  • Use sve attribute on functions.

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