[PATCH] D145159: [AMDGPU] Match med3 for (max (min ..))

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 5 23:50:04 PST 2023


Pierre-vh added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/saddsat.ll:27
+; GFX8-NEXT:    v_mov_b32_e32 v1, 0x7f
+; GFX8-NEXT:    v_med3_i32 v0, v0, s4, v1
 ; GFX8-NEXT:    s_setpc_b64 s[30:31]
----------------
arsenm wrote:
> foad wrote:
> > Pierre-vh wrote:
> > > Another example, this time it's 2 more instructions so it's a bit worse even.
> > The extra one is because you're using v_med3_i32 for a 16-bit operation. v_med3_i16 was introduced in gfx9.
> This should have been filtered out by the hasMed3_16 check
Should we just not do the combine if med3_16 is not available, instead of using the 32-bit version then?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145159



More information about the llvm-commits mailing list