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

Mirko Brkusanin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 09:08:15 PDT 2021


mbrkusanin added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h:595
 
+// Helper for ignoring a copy when matching
+template <typename SubPatternT> struct StripCopy_match {
----------------
foad wrote:
> 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?
m_Copy matches exactly one copy. This matches zero or one copy. Renamed to m_IgnoreCopy, StripCopy was a little misleading.

It could be easily changed to zero or more, but I did not run into a case where that was necessary.
In this patch we start from G_FMA/FMAD src operand which is vpgr and match until a constant (most likely a sgpr), so sooner or later a copy will appear.


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

https://reviews.llvm.org/D110937



More information about the llvm-commits mailing list