[all-commits] [llvm/llvm-project] a625bc: [HLSL][SPIR-V] Add hlsl_private address space for ...

Nathan Gauër via All-commits all-commits at lists.llvm.org
Thu Apr 10 01:55:33 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a625bc60e2987502d2dd1b3372fa1b9cf3b2f2cf
      https://github.com/llvm/llvm-project/commit/a625bc60e2987502d2dd1b3372fa1b9cf3b2f2cf
  Author: Nathan Gauër <brioche at google.com>
  Date:   2025-04-10 (Thu, 10 Apr 2025)

  Changed paths:
    M clang/include/clang/Basic/AddressSpaces.h
    M clang/include/clang/Sema/Sema.h
    M clang/include/clang/Sema/SemaHLSL.h
    M clang/lib/AST/Type.cpp
    M clang/lib/AST/TypePrinter.cpp
    M clang/lib/Basic/TargetInfo.cpp
    M clang/lib/Basic/Targets/AArch64.h
    M clang/lib/Basic/Targets/AMDGPU.cpp
    M clang/lib/Basic/Targets/DirectX.h
    M clang/lib/Basic/Targets/NVPTX.h
    M clang/lib/Basic/Targets/SPIR.h
    M clang/lib/Basic/Targets/SystemZ.h
    M clang/lib/Basic/Targets/TCE.h
    M clang/lib/Basic/Targets/WebAssembly.h
    M clang/lib/Basic/Targets/X86.h
    M clang/lib/CodeGen/CGDeclCXX.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaHLSL.cpp
    M clang/test/AST/HLSL/cbuffer.hlsl
    A clang/test/AST/HLSL/private.hlsl
    M clang/test/CodeGenHLSL/GlobalDestructors.hlsl
    M clang/test/CodeGenHLSL/cbuffer_with_static_global_and_function.hlsl
    A clang/test/CodeGenHLSL/out-of-line-static.hlsl
    A clang/test/CodeGenHLSL/static-variable.hlsl
    M clang/test/SemaTemplate/address_space-dependent.cpp
    M llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp

  Log Message:
  -----------
  [HLSL][SPIR-V] Add hlsl_private address space for SPIR-V (#133464)

This is an alternative to
https://github.com/llvm/llvm-project/pull/122103

In SPIR-V, private global variables have the Private storage class. This
PR adds a new address space which allows frontend to emit variable with
this storage class when targeting this backend.

This is covered in this proposal: llvm/wg-hlsl at 4c9e11a

This PR will cause addrspacecast to show up in several cases, like class
member functions or assignment. Those will have to be handled in the
backend later on, particularly to fixup pointer storage classes in some
functions.

Before this change, global variable were emitted with the 'Function'
storage class, which was wrong.



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