[PATCH] D149267: [AArch64][SVE] Add basic predicated add/sub patterns

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 08:24:03 PDT 2023


dmgreen added a comment.

Hello. Yes, that was actually the plan, but the other way around. There is a function that can canonicalize in the DAG through shouldFoldSelectWithIdentityConstant, to the `select(add)` form. Instcombine will fold the other way to `add(select(..))`. See d321f3aa64b4eaedd790dafe974cfdc0517cb22b <https://reviews.llvm.org/rGd321f3aa64b4eaedd790dafe974cfdc0517cb22b> for example. It is probably simpler to go via that method than dealing with the identity values for all node types (especially fp types). The predicated instructions are not as general in SVE as they are in MVE (MVE doesn't require destructive operands for many operations), but I think it should be better in general so long as there can always use predicated moves. I have patches for that and some other operations like and/or/xor/mul/mla/mls, but they needed some extra tests.

I will put the last part up now, that enables shouldFoldSelectWithIdentityConstant for SVE. There is one case that looks a little worse, but has a pair of selects that could be simplified.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149267/new/

https://reviews.llvm.org/D149267



More information about the llvm-commits mailing list