[PATCH] D78031: DAG: Fix wrong legality check for ISD::FMAD

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 09:39:51 PDT 2020


arsenm created this revision.
arsenm added reviewers: cameron.mcinally, spatel, nhaehnle, RKSimon, uweigand, mcberg2017.
Herald added subscribers: kerbowa, hiraditya, tpr, wdng, jvesely.

Since 1725f2884175ca618d29b06e35f5c6ebd618053d <https://reviews.llvm.org/rG1725f2884175ca618d29b06e35f5c6ebd618053d>/D69521 <https://reviews.llvm.org/D69521>, this should check
isFMADLegalForFAddFSub rather than the the plain isOperationLegal.

      

This would assert in a subset of cases due to an oddity in how FMAD is
selected. We will allow FMA formation pre-legalize, but not FMAD even
in cases where it would be valid.

The current hook requires passing in the root fadd/fsub. However, in
this distributed case, this would be far more complicated to pass in
the relevant operand. AMDGPU doesn't get any value from the node, and
only needs the type and is the only implementor, so I'm not sure why
we have this complexity. Just rename and expand the assert to avoid
the more complicated checks spread through the distribution logic.


https://reviews.llvm.org/D78031

Files:
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/lib/Target/AMDGPU/SIISelLowering.h
  llvm/test/CodeGen/AMDGPU/fmad-formation-fmul-distribute-denormal-mode.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78031.257007.patch
Type: text/x-patch
Size: 11490 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200413/fcac10b2/attachment.bin>


More information about the llvm-commits mailing list