[PATCH] D110937: [AMDGPU][GlobalISel] Select v_fma_mix_f32 and v_mad_mix_f32

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 08:31:00 PDT 2021


foad added a comment.

Looks like the logic is mostly copied from selectiondag, so I guess it's OK.



================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h:595
 
+// Helper for ignoring a copy when matching
+template <typename SubPatternT> struct StripCopy_match {
----------------
mbrkusanin wrote:
> Does this need to be a separate patch with a unit test?
Does this match exactly one copy? Would it be more useful to skip zero or more copies?


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp:2321-2323
+      (!Subtarget->hasMadMixInsts() && !Subtarget->hasFmaMixInsts()) ||
+      ((IsFMA && Subtarget->hasMadMixInsts()) ||
+       (!IsFMA && Subtarget->hasFmaMixInsts())))
----------------
I think these three lines can be replaced with `IsFMA ? !Subtarget->hasFmaMixInsts() : !Subtarget->hasMadMixInsts()`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110937



More information about the llvm-commits mailing list