[all-commits] [llvm/llvm-project] 80ba43: [amdgpu][nfc] Allocate kernel-specific LDS struct ...

Jon Chesterfield via All-commits all-commits at lists.llvm.org
Wed Sep 28 06:55:59 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 80ba432821206ee3ba4275d48ed6b50aadfbb9d8
      https://github.com/llvm/llvm-project/commit/80ba432821206ee3ba4275d48ed6b50aadfbb9d8
  Author: Jon Chesterfield <jonathanchesterfield at gmail.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
    M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
    A llvm/test/CodeGen/AMDGPU/lds-frame-extern.ll

  Log Message:
  -----------
  [amdgpu][nfc] Allocate kernel-specific LDS struct deterministically

A kernel may have an associated struct for laying out LDS variables.
This patch puts that instance, if present, at a deterministic address by
allocating it at the same time as the module scope instance.

This is relatively likely to be where the instance was allocated anyway (~NFC)
but will allow later patches to calculate where a given field can be found,
which means a function which is only reachable from a single kernel will be
able to access a LDS variable with zero overhead. That will be particularly
helpful for applications that instantiate a function template containing LDS
variables once per kernel.

Reviewed By: arsenm

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




More information about the All-commits mailing list