[all-commits] [llvm/llvm-project] 2e290d: [AMDGPU][DAGCombiner][GlobalISel] Extend allMulUse...

Adel Ejjeh via All-commits all-commits at lists.llvm.org
Mon Mar 23 14:24:16 PDT 2026


  Branch: refs/heads/users/adelejjeh/stop_duplication_on_contraction_p4
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e290daa8978f1cb3d8c4fae3b387cf387e72341
      https://github.com/llvm/llvm-project/commit/2e290daa8978f1cb3d8c4fae3b387cf387e72341
  Author: Adel Ejjeh <adel.ejjeh at amd.com>
  Date:   2026-03-23 (Mon, 23 Mar 2026)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/AMDGPU/dagcombine-fma-crash.ll
    M llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll

  Log Message:
  -----------
  [AMDGPU][DAGCombiner][GlobalISel] Extend allMulUsesCanBeContracted with FMA/FMAD pattern

Add conservative FMA/FMAD recognition to allMulUsesCanBeContracted:
a multiply used by an existing FMA/FMAD is assumed to be contractable
(it's already being contracted elsewhere). This avoids unnecessary
contraction blocking for multiplies that feed into FMA chains.

Also adds FMA/FMAD to the FPEXT user set (fpext(fmul) --> fma is
recognized as contractable when isFPExtFoldable).

Guards all remaining FMA-chain reassociation fold sites in both
SDAG (visitFADDForFMACombine/visitFSUBForFMACombine, 8 sites) and
GISel (matchCombineFAddFpExtFMulToFMadOrFMAAggressive, 4 sites).

This re-enables contractions that were conservatively blocked in
earlier patches where the multiply had an FMA use that wasn't yet
recognized: dagcombine-fma-crash.ll and dagcombine-fma-fmad.ll
CHECK lines revert to upstream behavior.

Co-Authored-By: Claude Opus 4.6 <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list