[all-commits] [llvm/llvm-project] 62fd85: [HLSL] Add `InterlockedExchange` function and reso...

Joshua Batista via All-commits all-commits at lists.llvm.org
Thu Sep 24 11:12:36 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 62fd85fe5a008a88d1d00aab468a8779aac4bd0a
      https://github.com/llvm/llvm-project/commit/62fd85fe5a008a88d1d00aab468a8779aac4bd0a
  Author: Joshua Batista <jbatista at microsoft.com>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

  Changed paths:
    M clang/include/clang/Basic/Builtins.td
    M clang/lib/CodeGen/CGHLSLBuiltins.cpp
    M clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.cpp
    M clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.h
    M clang/lib/Sema/HLSLExternalSemaSource.cpp
    M clang/lib/Sema/SemaHLSL.cpp
    A clang/test/CodeGenHLSL/builtins/InterlockedExchange.hlsl
    M clang/test/CodeGenHLSL/builtins/RWBuffer-Interlocked.hlsl
    A clang/test/CodeGenHLSL/builtins/RWByteAddressBuffer-InterlockedExchange.hlsl
    M clang/test/CodeGenHLSL/builtins/RWTexture-Interlocked.hlsl
    M clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedAdd.hlsl
    M clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedAnd.hlsl
    A clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedExchange.hlsl
    M clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedMax.hlsl
    M clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedMin.hlsl
    M clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedOr.hlsl
    M clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedXor.hlsl
    A clang/test/SemaHLSL/BuiltIns/ByteAddressBuffer-InterlockedExchange-errors.hlsl
    A clang/test/SemaHLSL/BuiltIns/ByteAddressBuffer-InterlockedExchange-sm65-errors.hlsl
    A clang/test/SemaHLSL/BuiltIns/InterlockedExchange-errors.hlsl

  Log Message:
  -----------
  [HLSL] Add `InterlockedExchange` function and resource methods (#222161)

This PR adds the `InterlockedExchange` standalone function and resource
methods. The operation lowers to `atomicrmw xchg`.

`InterlockedExchange` is the first interlocked operation that reports
the
previous value. It takes that value through an `original_value`
reference
parameter, so this PR adds a `RequiresOriginalValue` flag to
`HLSLBuiltinTypeDeclBuilder` and a matching overload shape to
`HLSLExternalSemaSource`. The later compare operations reuse both.

The float overload of `InterlockedExchange` follows in a separate PR in
this
stack. This PR covers the integer overloads alone, so it links
https://github.com/llvm/llvm-project/issues/99129 without closing it.

Assisted by: Github Copilot



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