[PATCH] D90050: AMDGPU/GlobalISel: Add integer med3 combines

Petar Avramovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 04:03:56 PDT 2021


Petar.Avramovic added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp:115
+  LLT Ty = MRI.getType(Dst);
+  if (Ty != LLT::scalar(16) && Ty != LLT::scalar(32))
+    return false;
----------------
foad wrote:
> foad wrote:
> > Can we just assert the type is one of these, since we're running on legalized GMIR and these are the only types that we have integer min/max instructions for? (Or do we need to exclude v2s16?)
> Ping? Maybe just `if (Ty.isVector()) return false;`?
We need to exclude v2s16, there is a test that we don't combine in this case.
I did find it more informative this way since it is explicit about available types for med3.



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

https://reviews.llvm.org/D90050



More information about the llvm-commits mailing list