[all-commits] [llvm/llvm-project] 4d4ce8: [AMDGPU] Add LDS encoding granularity to TargetParser

Chinmay Deshpande via All-commits all-commits at lists.llvm.org
Sun Sep 20 19:00:24 PDT 2026


  Branch: refs/heads/users/chinmaydd/lds-encoding-granule
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d4ce81c9e5752607f0659e0edd5cfaa08b289ad
      https://github.com/llvm/llvm-project/commit/4d4ce81c9e5752607f0659e0edd5cfaa08b289ad
  Author: Chinmay Deshpande <chdeshpa at amd.com>
  Date:   2026-09-20 (Sun, 20 Sep 2026)

  Changed paths:
    M llvm/include/llvm/TargetParser/AMDGPUTargetParser.h
    M llvm/lib/Target/AMDGPU/AMDGPU.td
    M llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUFeatures.td
    M llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
    M llvm/lib/Target/AMDGPU/R600Processors.td
    M llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
    M llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
    M llvm/lib/TargetParser/AMDGPUTargetParser.cpp
    A llvm/test/CodeGen/AMDGPU/lds-size-gfx1030.ll
    A llvm/test/CodeGen/AMDGPU/lds-size-gfx9-4-generic.ll
    M llvm/test/TableGen/AMDGPUTargetDefLDSAllocGranularity.td
    M llvm/unittests/TargetParser/TargetParserTest.cpp

  Log Message:
  -----------
  [AMDGPU] Add LDS encoding granularity to TargetParser

Model LDS encoding granularity with dedicated features and expose the
byte-valued getLDSEncodingGranule query for GPUKind and subarch. Keep
encoding independent of the hardware allocation granularity used for
occupancy; GFX10.3, GFX11 and GFX12.0 encode in 512-byte units while
allocating 1024-byte blocks.

Migrate program resource register and PAL metadata encoding to the new
query and remove getLdsDwGranularity from AMDGPUBaseInfo. gfx9-4-generic
uses gfx950's 1280-byte encoding granule independently of LDS capacity.

Test encoding queries, feature membership, generic-target validation and
encoded LDS sizes, including the GFX10.3 allocation/encoding distinction.

Change-Id: I9d3c2c041605e9a45fa8fbda09fc3460a74953ea


  Commit: 8cafdaaadf3a9c4476f71218461bbadd3faa5b04
      https://github.com/llvm/llvm-project/commit/8cafdaaadf3a9c4476f71218461bbadd3faa5b04
  Author: Chinmay Deshpande <chdeshpa at amd.com>
  Date:   2026-09-20 (Sun, 20 Sep 2026)

  Changed paths:
    M llvm/include/llvm/TargetParser/AMDGPUTargetParser.h
    M llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
    M llvm/lib/TargetParser/AMDGPUTargetParser.cpp
    A llvm/test/CodeGen/AMDGPU/lds-size-default-device.ll
    M llvm/unittests/TargetParser/TargetParserTest.cpp

  Log Message:
  -----------
  [AMDGPU] Return zero LDS encoding granularity for dummy targets

Remove the redundant early return and assertion from getLDSEncodingGranule. Return zero when the target has no encoding granularity feature, and document and test the result for unknown and legacy generic targets.

Keep the existing 256-byte default in the assembly printer so compiling without a GPU still produces valid LDS sizes. Test default-target Mesa and PAL encodings and HSA metadata.

Change-Id: Ia0c69a0d7ce2858b31ee64100d37ae34bba6c42c


Compare: https://github.com/llvm/llvm-project/compare/147b3d9cf0f2...8cafdaaadf3a

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list