[all-commits] [llvm/llvm-project] 581f83: [ARM] Fold (fadd x, (vselect c, y, -1.0)) into (vs...

David Green via All-commits all-commits at lists.llvm.org
Wed Nov 24 02:41:13 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 581f837355b9523bd3217fb05eed3d577d51b95d
      https://github.com/llvm/llvm-project/commit/581f837355b9523bd3217fb05eed3d577d51b95d
  Author: David Green <david.green at arm.com>
  Date:   2021-11-24 (Wed, 24 Nov 2021)

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

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

This is similar to 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.

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




More information about the All-commits mailing list