[all-commits] [llvm/llvm-project] 4ba503: [AMDGPU][DAGCombiner][GlobalISel] Extend allMulUse...

Adel Ejjeh via All-commits all-commits at lists.llvm.org
Mon Mar 30 08:54:49 PDT 2026


  Branch: refs/heads/users/adelejjeh/stop_duplication_on_contraction_p4
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ba5032d5357180f1a69970b247d632792e8eb17
      https://github.com/llvm/llvm-project/commit/4ba5032d5357180f1a69970b247d632792e8eb17
  Author: Adel Ejjeh <adel.ejjeh at amd.com>
  Date:   2026-03-30 (Mon, 30 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
    M llvm/test/CodeGen/AMDGPU/fma-multiple-uses-contraction.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>
Made-with: Cursor



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