[llvm] 6d5a653 - [AMDGPU] New PAL metadata updates to ps_extra_lds_size and float_mode

David Stuttard via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 04:49:21 PDT 2023


Author: David Stuttard
Date: 2023-06-06T12:18:21+01:00
New Revision: 6d5a653dda628250b373ec89e0e11cdd27603c24

URL: https://github.com/llvm/llvm-project/commit/6d5a653dda628250b373ec89e0e11cdd27603c24
DIFF: https://github.com/llvm/llvm-project/commit/6d5a653dda628250b373ec89e0e11cdd27603c24.diff

LOG: [AMDGPU] New PAL metadata updates to ps_extra_lds_size and float_mode

New metadata format contains full calculation of field contents for
ps_extra_lds_size (vs old format where the value in RSRC register is used by PAL
to calculate the value required).

Also stop updating float_mode and rely on front end settings for this field.

Differential Revision: https://reviews.llvm.org/D152247

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
index fb3ce11a495e7..653f3172c0ac1 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -1045,10 +1045,6 @@ void AMDGPUAsmPrinter::EmitPALMetadata(const MachineFunction &MF,
         MD->setRsrc2(CC, S_00B84C_SCRATCH_EN(1));
     }
   } else {
-    // Priority?
-    MD->setHwStage(CC, ".float_mode", CurrentProgramInfo.FloatMode);
-    // Priv?
-    // DX10Clamp?
     MD->setHwStage(CC, ".debug_mode", (bool)CurrentProgramInfo.DebugMode);
     MD->setHwStage(CC, ".ieee_mode", (bool)CurrentProgramInfo.IEEEMode);
     MD->setHwStage(CC, ".wgp_mode", (bool)CurrentProgramInfo.WgpMode);
@@ -1082,7 +1078,12 @@ void AMDGPUAsmPrinter::EmitPALMetadata(const MachineFunction &MF,
       MD->setSpiPsInputAddr(MFI->getPSInputAddr());
     } else {
       // Graphics registers
-      MD->setGraphicsRegisters(".ps_extra_lds_size", ExtraLDSSize);
+      const unsigned ExtraLdsDwGranularity =
+          STM.getGeneration() >= AMDGPUSubtarget::GFX11 ? 256 : 128;
+      MD->setGraphicsRegisters(
+          ".ps_extra_lds_size",
+          (unsigned)(ExtraLDSSize * ExtraLdsDwGranularity * sizeof(uint32_t)));
+
       // Set PsInputEna and PsInputAddr .spi_ps_input_ena and .spi_ps_input_addr
       static StringLiteral const PsInputFields[] = {
           ".persp_sample_ena",    ".persp_center_ena",


        


More information about the llvm-commits mailing list