[all-commits] [llvm/llvm-project] 3c3f53: [HLSL] Emit cbuffer global variables with internal...

Helena Kotas via All-commits all-commits at lists.llvm.org
Fri Jun 5 16:55:39 PDT 2026


  Branch: refs/heads/users/hekota/pr200312-emit-cbuffer-globals-as-internal
  Home:   https://github.com/llvm/llvm-project
  Commit: 3c3f5344562a88e2b52bad895d1cf3621bfe157c
      https://github.com/llvm/llvm-project/commit/3c3f5344562a88e2b52bad895d1cf3621bfe157c
  Author: Helena Kotas <hekotas at microsoft.com>
  Date:   2026-05-28 (Thu, 28 May 2026)

  Changed paths:
    M clang/lib/CodeGen/CGHLSLRuntime.cpp
    M clang/test/CodeGenHLSL/ArrayAssignable.hlsl
    M clang/test/CodeGenHLSL/ArrayAssignable.logicalptr.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer-empty-struct-array.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer_and_namespaces.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer_with_packoffset.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer_with_static_global_and_function.hlsl
    M clang/test/CodeGenHLSL/resources/default_cbuffer.hlsl
    M clang/test/CodeGenHLSL/resources/default_cbuffer_with_layout.hlsl
    M clang/test/CodeGenHLSL/vk_binding_attr.hlsl

  Log Message:
  -----------
  [HLSL] Emit cbuffer global variables with internal linkage


  Commit: 61d11a704aa52b2d652d9817017e83a0c00df7b4
      https://github.com/llvm/llvm-project/commit/61d11a704aa52b2d652d9817017e83a0c00df7b4
  Author: Helena Kotas <hekotas at microsoft.com>
  Date:   2026-06-02 (Tue, 02 Jun 2026)

  Changed paths:
    M clang/lib/CodeGen/CGHLSLRuntime.cpp
    M clang/test/CodeGenHLSL/ArrayAssignable.hlsl
    M clang/test/CodeGenHLSL/ArrayAssignable.logicalptr.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer-empty-struct-array.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer_and_namespaces.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer_with_packoffset.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer_with_static_global_and_function.hlsl
    M clang/test/CodeGenHLSL/resources/default_cbuffer.hlsl
    M clang/test/CodeGenHLSL/resources/default_cbuffer_with_layout.hlsl
    M clang/test/CodeGenHLSL/vk_binding_attr.hlsl

  Log Message:
  -----------
  Change the global visibility to hidden external

Unused globals with internal linkage get optimized away in GlobalOptPass
with `-O3`. The global created for cbuffer appears unused, and we need
to keep it alive until the {DXIL|SPRIV}CBufferAccess pass.


  Commit: 3702133d09101a8103b94279aa9bed43990b478f
      https://github.com/llvm/llvm-project/commit/3702133d09101a8103b94279aa9bed43990b478f
  Author: Helena Kotas <hekotas at microsoft.com>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    M clang/lib/CodeGen/CGHLSLRuntime.cpp
    M clang/test/CodeGenHLSL/ArrayAssignable.hlsl
    M clang/test/CodeGenHLSL/ArrayAssignable.logicalptr.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer-empty-struct-array.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer_and_namespaces.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer_with_packoffset.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer_with_static_global_and_function.hlsl
    M clang/test/CodeGenHLSL/resources/default_cbuffer.hlsl
    M clang/test/CodeGenHLSL/resources/default_cbuffer_with_layout.hlsl
    M clang/test/CodeGenHLSL/vk_binding_attr.hlsl

  Log Message:
  -----------
  Revert "Change the global visibility to hidden external"

This reverts commit 61d11a704aa52b2d652d9817017e83a0c00df7b4.


  Commit: d439fac25c03432a60e4211ea0a4ec1b6714a8e2
      https://github.com/llvm/llvm-project/commit/d439fac25c03432a60e4211ea0a4ec1b6714a8e2
  Author: Helena Kotas <hekotas at microsoft.com>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    M clang/lib/CodeGen/CGHLSLRuntime.cpp
    M clang/test/CodeGenHLSL/vk_binding_attr.hlsl
    M llvm/include/llvm/Frontend/HLSL/CBuffer.h
    M llvm/lib/Frontend/HLSL/CBuffer.cpp
    M llvm/lib/Target/DirectX/DXILCBufferAccess.cpp
    M llvm/lib/Target/SPIRV/SPIRVCBufferAccess.cpp
    A llvm/test/CodeGen/DirectX/cbuffer_global_elim.ll
    A llvm/test/CodeGen/SPIRV/cbuffer_global_elim.ll

  Log Message:
  -----------
  Add CBuffer global to `@llvm.used` so it does not get optimized away
by GlobalOptPass before it reaches {DXIL|SPIRV}CBufferAccess pass.

Remove the CBuffer global from `@llvm.used` list in {DXIL|SPIRV}CBufferAccess
pass after individual CBuffer constants are replaced with accesses via the
CBuffer handle.


  Commit: 5f5ae408d0f3bab1aa776ad82e2a2153cb2cf562
      https://github.com/llvm/llvm-project/commit/5f5ae408d0f3bab1aa776ad82e2a2153cb2cf562
  Author: Helena Kotas <hekotas at microsoft.com>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    M clang/test/CodeGenHLSL/vk_binding_attr.hlsl

  Log Message:
  -----------
  remove whitespace


Compare: https://github.com/llvm/llvm-project/compare/3c3f5344562a%5E...5f5ae408d0f3

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