[PATCH] D108619: [DAGCombine] Allow FMA combine with both FMA and FMAC

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 24 02:09:49 PDT 2021


foad added a comment.

> will not be merged post legalization as FMAC becomes
> the preferred fusion opcode

I'm not sure wha you mean about FMAD "becoming the preferred fusion opcode". Is that just an AMDGPU quirk? Or is there something in generic code that prefers FMA before legalization and FMAD after??



================
Comment at: llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll:5
+; GCN-LABEL: {{^}}_amdgpu_ps_main:
+; GCN:     v_fma
+; GCN:     v_fma
----------------
Could use `GCN-COUNT-13: v_fma`.

But maybe it would be better to generate the checks for this file? It's not immediately obvious (to me) why 13 is the optimal number of fmas. There are more than 13 fmuls and fadds and fsubs in the IR.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108619/new/

https://reviews.llvm.org/D108619



More information about the llvm-commits mailing list