[PATCH] D149967: [AArch64][SVE] Enable shouldFoldSelectWithIdentityConstant for SVE.
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 5 08:40:14 PDT 2023
dmgreen created this revision.
dmgreen added reviewers: paulwalker-arm, sdesmalen, david-arm, SjoerdMeijer, efriedma.
Herald added subscribers: ctetreau, rogfer01, psnobl, hiraditya, kristof.beyls, tschuett.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added subscribers: alextsao1999, vkmr.
Herald added a project: LLVM.
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 I have other patches for, most of which are fairly simple.
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.
https://reviews.llvm.org/D149967
Files:
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
llvm/test/CodeGen/AArch64/sve-fp-int-min-max.ll
llvm/test/CodeGen/AArch64/sve-pred-selectop3.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149967.519873.patch
Type: text/x-patch
Size: 35798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230505/363eb354/attachment.bin>
More information about the llvm-commits
mailing list