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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 05:05:48 PST 2023


arsenm accepted this revision.
arsenm added a comment.
This revision is now accepted and ready to land.

LGTM with nit



================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:10625
+  // will often need to be materialized & extended, especially on
+  // pre-GFX10 where VOP3 instructions couldn't take literal operands.
   return SDValue();
----------------
Probably fine if both constants have multiple uses already, not worth it for this particular patch 


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:10753
+      return Med3;
+  } else if (Opc == ISD::UMAX && Op0.getOpcode() == ISD::UMIN &&
+             Op0.hasOneUse()) {
----------------
No else after return


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