[llvm] AMDGPU: Remove dead code for printing DFP immediates (PR #156644)
    Matt Arsenault via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Sep  3 03:50:35 PDT 2025
    
    
  
https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/156644
Nothing in the backend uses these, so there's no reason
to support printing them.
>From 0c03f09a84cef2bfc5a2dfa091fc5f07b839f001 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Wed, 3 Sep 2025 19:48:10 +0900
Subject: [PATCH] AMDGPU: Remove dead code for printing DFP immediates
Nothing in the backend uses these, so there's no reason
to support printing them.
---
 .../AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp    | 16 ----------------
 1 file changed, 16 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
index b9cbf35fcbec6..5f72f72cf8710 100644
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
@@ -792,22 +792,6 @@ void AMDGPUInstPrinter::printRegularOperand(const MCInst *MI, unsigned OpNo,
       // custom printer.
       llvm_unreachable("unexpected immediate operand type");
     }
-  } else if (Op.isDFPImm()) {
-    double Value = bit_cast<double>(Op.getDFPImm());
-    // We special case 0.0 because otherwise it will be printed as an integer.
-    if (Value == 0.0)
-      O << "0.0";
-    else {
-      const MCInstrDesc &Desc = MII.get(MI->getOpcode());
-      int RCID = Desc.operands()[OpNo].RegClass;
-      unsigned RCBits = AMDGPU::getRegBitWidth(MRI.getRegClass(RCID));
-      if (RCBits == 32)
-        printImmediate32(llvm::bit_cast<uint32_t>((float)Value), STI, O);
-      else if (RCBits == 64)
-        printImmediate64(llvm::bit_cast<uint64_t>(Value), STI, O, true);
-      else
-        llvm_unreachable("Invalid register class size");
-    }
   } else if (Op.isExpr()) {
     const MCExpr *Exp = Op.getExpr();
     MAI.printExpr(O, *Exp);
    
    
More information about the llvm-commits
mailing list