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

David Stuttard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 02:08:17 PDT 2023


dstuttard created this revision.
Herald added subscribers: foad, kerbowa, hiraditya, tpr, yaxunl, jvesely, kzhuravl, arsenm.
Herald added a project: All.
dstuttard requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152247

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


Index: llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -1045,10 +1045,6 @@
         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 @@
       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",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152247.528746.patch
Type: text/x-patch
Size: 1296 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230606/06a6f57d/attachment.bin>


More information about the llvm-commits mailing list