HLSL Working Group

2026-09-03 - HLSL Working Group Minutes

Discussion Topics

  • This week in HLSL
  • Ambiguous overloads
  • IsTokenLike and resource target types
  • Vulkan target environment support
  • HLSL Pack/Unpack Math Intrinsics
  • Requests for Review

Meeting Notes

This Week in HLSL

This week had 45 PRs merged in HLSL.

The DirectX backend is no longer experimental! Thanks to everyone’s hard work to make this happen. The HLSL frontend saw matrix and long vector support improvements as well as progress on Texture types. In SPIR-V we saw various legalization and lowering improvements, as well as more work on the NewPM migration.

There were 15 new PRs opened, and there are 56 PRs currently ongoing.

For a full list of merged PRs, see the appendix.

Ambiguous Overloads

We followed up on ambiguous overloads of max and min, and agreed that adding compatibility overloads for these probably makes sense. @pow2clk will create a pull request.

IsTokenLike and Resource Target Types

A discussion on semantics of target extension types pointed out that there are inconsistencies with how DirectX resource types are using IsTargetType. @bogner explained that we found that attribute insufficient to handle everything that HLSL allows and we had to implement solutions separately anyway. Because of this we’re going to drop it from the resource types entirely.

Vulkan Target Environment Support

@pow2clk asked if there were strong reasons that we’re only supporting vulkan target environments of 1.2 and higher. @llvm-beanz recalled that @s-perron chose this as a baseline because it generally has broad support, and that there wasn’t a particularly strong reason to exclude 1.1 other than that we may not need it.

HLSL Pack/Unpack Math Intrinsics

@Alexander-Johnston noted that the DirectX documentation for Pack/Unpack Math Intrinsics only state they can be converted to and from uint32_t values, but DXC’s support is much more permissive. @llvm-beanz pointed out that there are existing HLSL modifications to the usual arithmetic conversions that are applicable if we need to support the more permissive set of conversions for compatibility.

Requests for Review

No particular pull requests were called out this week.

Appendix: Merged PRs

HLSL Frontend

  • [HLSL] Add matrix support for float->float pure function intrinsics (llvm/llvm-project#202455)
  • [HLSL] Move normalize implementation to header files (llvm/llvm-project#216228)
  • [LongVec] Add Support for pure HLSL APIs (llvm/llvm-project#218155)
  • [NFC][HLSL] Generalize and consolidate texture tests (llvm/llvm-project#218519)
  • [HLSL] Implement TextureCube resource type (llvm/llvm-project#218520)
  • [HLSL] Implement TextureCubeArray resource type (llvm/llvm-project#218521)
  • [HLSL] Add matrix support for degrees(), radians() (llvm/llvm-project#218573)
  • [HLSL] Add UAV-specific texture load method (llvm/llvm-project#218728)
  • [Matrix] Implement matrix support for the max and min intrinsics (llvm/llvm-project#219537)
  • [NFC][HLSL] Refactor texture type declaration (llvm/llvm-project#219561)
  • [HLSL][LongVec] Add support for select (llvm/llvm-project#219603)
  • [HLSL] Fix initialization of mips’ copy of the resource handle (llvm/llvm-project#220349)

DirectX Backend

  • [DirectX] Promote to an official target (llvm/llvm-project#214066)
  • [DirectX] Fix -Wunused-variable in release builds (llvm/llvm-project#220030)
  • [NFC][DirectX] Fix memory leaks exposed by ASAN (llvm/llvm-project#220152)
  • [DirectX] Don’t expect specific zlib compressed size (llvm/llvm-project#220211)
  • [DirectX] Make DXILDebugInfo report that it Modified the IR (llvm/llvm-project#220242)
  • [NFC][DirectX] Fix a memory leak in resource access (llvm/llvm-project#220350)

SPIR-V Backend

  • [SPIR-V] Always reject OpTypeVector with a non-standard width (llvm/llvm-project#212685)
  • [SPIR-V] Honor explicit memory_order/memory_scope in atomic load/store (llvm/llvm-project#215572)
  • Add support for DebugLexicalBlock. (llvm/llvm-project#217965)
  • [SPIRV] Evaluate G_ZEXT fewerElementsIf before vector size legality rules (llvm/llvm-project#219017)
  • [SPIR-V] Erase all instructions after OpKill, not just the next one (llvm/llvm-project#219022)
  • [NFC][SPIRV] Fix dangling reference to a temporary MachineInstrBuilder (llvm/llvm-project#219243)
  • [SPIRV] Simplify 64 bit popcount for Vulkan (llvm/llvm-project#219605)
  • [SPIRV] Converge different resolveDebugParentScope versions into a single one (llvm/llvm-project#219925)
  • [NFC][SPIRV] Converge different DIScope to MCRegister maps into a single one (llvm/llvm-project#219927)

Offload Test Suite

  • Add matrix tests for isinf() and isnan() (llvm/offload-test-suite#1397)
  • Add InterlockedCompareExchangeFloatBitwise tests (llvm/offload-test-suite#1450)
  • Add max and min matrix tests (llvm/offload-test-suite#1459)
  • [Vulkan][DirectX] Refactor texture handling in anticipation of other texture types (llvm/offload-test-suite#1465)
  • [Vulkan][DirectX] Add support for array textures, starting with Texture2DArray and RWTexture2DArray (llvm/offload-test-suite#1468)
  • Add select matrix tests (llvm/offload-test-suite#1472)
  • [HLSL] Add matrix tests for degrees(), radians() (llvm/offload-test-suite#1475)
  • [Vulkan][DirectX] Add tests and support for TextureCube and TextureCubeArray (llvm/offload-test-suite#1476)
  • Update stale XFAIL tracker links (llvm/offload-test-suite#1482)
  • [XFAIL][Clang] Enable FP long vector dot product (llvm/offload-test-suite#1484)
  • [XFAIL][Clang] Enable spv-use-legacy-buffer-matrix-order tests (llvm/offload-test-suite#1485)
  • Add clang-resource-headers to distribution cmake (llvm/offload-test-suite#1488)
  • Remove Clang XFAILs from max and min matrix tests (llvm/offload-test-suite#1493)
  • [Clang][VK] Enable abs long vectors (llvm/offload-test-suite#1496)

New PM

  • [SPIRV][NewPM] Port SPIRVPreLegalizer (llvm/llvm-project#219104)
  • [SPIRV][NewPM] Port SPIRVPreLegalizerCombiner (llvm/llvm-project#219108)
  • [SPIRV][NewPM] Port SPIRVPostLegalizer (llvm/llvm-project#219109)
  • [SPIRV][NewPM] Port AsmPrinter (llvm/llvm-project#219111)