[all-commits] [llvm/llvm-project] e6f948: [SelectionDAG] Flags are dropped when creating a n...

Sirish Pande via All-commits all-commits at lists.llvm.org
Thu Sep 21 08:26:49 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e6f9483f77dbbdfdc010f8db2bbb0e236820eddb
      https://github.com/llvm/llvm-project/commit/e6f9483f77dbbdfdc010f8db2bbb0e236820eddb
  Author: Sirish Pande <sirpande at amd.com>
  Date:   2023-09-21 (Thu, 21 Sep 2023)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/test/CodeGen/AMDGPU/fma.ll

  Log Message:
  -----------
  [SelectionDAG] Flags are dropped when creating a new FMUL (#66701)

While simplifying some vector operators in DAG combine, we may need to
create new instructions for simplified vectors. At that time, we need to
make sure that all the flags of the new instruction are copied/modified
from the old instruction.

If "contract" is dropped from an instruction like FMUL, it may not
generate FMA instruction which would impact performance.

Here's an example where "contract" flag is dropped when FMUL is created.

Replacing.2 t42: v2f32 = fmul contract t41, t38
With: t48: v2f32 = fmul t38, t38

Co-authored-by: Sirish Pande <sirish.pande at amd.com>




More information about the All-commits mailing list