[PATCH] D113584: [ARM] Fold (fadd x, (vselect c, y, -1.0)) into (vselect c, (fadd x, y), x)

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 10 10:37:59 PST 2021


dmgreen created this revision.
dmgreen added reviewers: SjoerdMeijer, samtebbs, ostannard, simon_tatham.
Herald added subscribers: hiraditya, kristof.beyls.
dmgreen requested review of this revision.
Herald added a project: LLVM.

This is similar to D113574 <https://reviews.llvm.org/D113574>, but as a DAG combine, not tablegen patterns. Doing the fold as a DAG combine allows the fadd to be folded with a fmul, finally producing a predicated vfma. It performs the same fold of `fadd(x, vselect(p, y, -0.0))` to `vselect p, (fadd x, y), x)` using -0.0 as the identity value of a fadd.


https://reviews.llvm.org/D113584

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/test/CodeGen/Thumb2/mve-pred-selectop3.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113584.386228.patch
Type: text/x-patch
Size: 4088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211110/34343bda/attachment.bin>


More information about the llvm-commits mailing list