[clang] [llvm] Add InterlockedAdd resource methods (PR #208128)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 15 07:24:50 PDT 2026
================
@@ -0,0 +1,80 @@
+// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple \
+// RUN: dxil-pc-shadermodel6.6-compute %s -emit-llvm -disable-llvm-passes -o - | \
+// RUN: FileCheck %s --check-prefixes=CHECK,DXCHECK
+
+// Test that the RWByteAddressBuffer::InterlockedAdd and
+// RasterizerOrderedByteAddressBuffer::InterlockedAdd member methods lower to
+// `dx.resource.getpointer.typed -> dx.interlocked.add`, and that the
+// 3-argument overload stores the returned original value through the out
+// parameter.
+
+RWByteAddressBuffer BAB : register(u0);
+RasterizerOrderedByteAddressBuffer ROVB : register(u1);
+
+// CHECK-LABEL: define {{(dso_local |hidden |internal |protected |spir_func )*}}void @{{.*}}test_bab_int_2arg
----------------
farzonl wrote:
wait why is this `|hidden |internal |protected`? it should just be one of these.
https://github.com/llvm/llvm-project/pull/208128
More information about the cfe-commits
mailing list