[llvm] [AMDGPU] Promote uniform ops to I32 in DAGISel (PR #106383)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 05:29:07 PDT 2024


================
@@ -1022,14 +1022,45 @@ bool AMDGPUTargetLowering::isZExtFree(EVT Src, EVT Dest) const {
   return Src == MVT::i32 && Dest == MVT::i64;
 }
 
-bool AMDGPUTargetLowering::isNarrowingProfitable(EVT SrcVT, EVT DestVT) const {
+bool AMDGPUTargetLowering::isNarrowingProfitable(SDNode *N, EVT SrcVT,
+                                                 EVT DestVT) const {
+  switch (N->getOpcode()) {
+  case ISD::ADD:
+  case ISD::SUB:
+  case ISD::SHL:
+  case ISD::SRL:
+  case ISD::SRA:
+  case ISD::AND:
+  case ISD::OR:
+  case ISD::XOR:
+  case ISD::MUL:
+  case ISD::SETCC:
+  case ISD::SELECT:
+    if (Subtarget->has16BitInsts() &&
+        (DestVT.isVector() ? !Subtarget->hasVOP3PInsts() : true)) {
----------------
arsenm wrote:

DestVT.isVector() && !Subtarget->hasVOP3PInsts()

https://github.com/llvm/llvm-project/pull/106383


More information about the llvm-commits mailing list