[llvm] [AMDGPU] Handle hazard in v_scalef32_sr_fp4_* conversions (PR #118589)

Pravin Jagtap via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 08:48:14 PST 2024


================
@@ -657,9 +658,14 @@ bool isTrue16Inst(unsigned Opc) {
   return Info ? Info->IsTrue16 : false;
 }
 
-bool isFP8DstSelInst(unsigned Opc) {
-  const FP8DstByteSelInfo *Info = getFP8DstByteSelHelper(Opc);
-  return Info ? Info->HasFP8DstByteSel : false;
+FPType getFPDstSelType(unsigned Opc) {
+  const FP4FP8DstByteSelInfo *Info = getFP4FP8DstByteSelHelper(Opc);
+  if (Info && Info->HasFP8DstByteSel)
+    return FPType::FP8;
+  else if (Info && Info->HasFP4DstByteSel)
+    return FPType::FP4;
+  else
+    return FPType::None;
----------------
pravinjagtap wrote:

Need to use `return None` instead of `llvm_unreachable`. We can reach here for other instructions for handling dst forwarding hazard.

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


More information about the llvm-commits mailing list