[all-commits] [llvm/llvm-project] 164319: [AArch64][SVE] Enable shouldFoldSelectWithIdentity...

David Green via All-commits all-commits at lists.llvm.org
Thu Jun 15 01:18:03 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1643197e1911a81a939debcd0af99635d53bc831
      https://github.com/llvm/llvm-project/commit/1643197e1911a81a939debcd0af99635d53bc831
  Author: David Green <david.green at arm.com>
  Date:   2023-06-15 (Thu, 15 Jun 2023)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.h
    M llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
    M llvm/test/CodeGen/AArch64/sve-fp-int-min-max.ll
    M llvm/test/CodeGen/AArch64/sve-pred-selectop2.ll
    M llvm/test/CodeGen/AArch64/sve-pred-selectop3.ll

  Log Message:
  -----------
  [AArch64][SVE] Enable shouldFoldSelectWithIdentityConstant for SVE.

Instcombine will canonicalize `select(c, binop(a, b), a)` to
`binop(select(c, b, identityvalue), a)`. The original select form
makes a more natural form for vector predicated operations for
vector architectures like SVE where predication is well supported.
This patch enables shouldFoldSelectWithIdentityConstant for SVE so
that more predicated instructions can be generated, helping simplify
the handling with identity constants.

Predicated FMA patterns have also been adjusted here as they need to
look at FMF's. Other operations like add/sub, mul, and/or/xor and
mla/mls have been recently updated.

There is one test (scalable_int_min_max) that increases in size. There
are multiple selects that could be combined into a single select but
does not currently fold.

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




More information about the All-commits mailing list