[PATCH] D129623: [AArch64][SVE] Fold fadda(ptrue, x, select(mask, y, -0.0)) into fadda(mask, x, y)

Rosie Sumpter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 01:58:11 PDT 2022


RosieSumpter created this revision.
RosieSumpter added reviewers: david-arm, sdesmalen, dmgreen, CarolineConcatto, kmclaughlin.
Herald added subscribers: ctetreau, psnobl, hiraditya, kristof.beyls, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: All.
RosieSumpter requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch adds an SVE pattern to recognize the use of a select with an
fadda in the form fadda(ptrue, x, select(mask, y, -0.0)). In this case
the select can be folded away, with the select mask used as the
predicate for fadda. This improves the codegen when vectorizing loops
with ordered fp reductions.

Tests have been added for the f16 cases, although the folding doesn't
currently work for these as -0.0 isn't treated as a legal f16 immediate.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129623

Files:
  llvm/lib/Target/AArch64/AArch64InstrFormats.td
  llvm/lib/Target/AArch64/SVEInstrFormats.td
  llvm/test/CodeGen/AArch64/sve-fadda-select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129623.444189.patch
Type: text/x-patch
Size: 8083 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220713/d0127a5c/attachment.bin>


More information about the llvm-commits mailing list