[clang] [HLSL] Add `InterlockedMax` function and resource methods (PR #222160)
Finn Plummer via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 16 11:50:14 PDT 2026
================
@@ -0,0 +1,74 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
+// RUN: dxil-pc-shadermodel6.6-library %s -emit-llvm -disable-llvm-passes -o - | \
+// RUN: FileCheck %s --check-prefixes=CHECK,DXCHECK
+
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
+// RUN: spirv-pc-vulkan-library %s -emit-llvm -disable-llvm-passes -o - | \
+// RUN: FileCheck %s --check-prefixes=CHECK,SPVCHECK
+
+// Test signed and unsigned lowering of HLSL InterlockedMax.
+
+groupshared int gs_i32;
+groupshared uint gs_u32;
+groupshared int64_t gs_i64;
+groupshared uint64_t gs_u64;
+
+// CHECK-LABEL: define {{.*}}void @{{.*}}test_int_2arg
----------------
inbelic wrote:
nit: the CHECK-LABEL pattern drifted from the file this test mirrors. `InterlockedMin.hlsl` uses
```
// CHECK-LABEL: define {{(dso_local |hidden |internal |protected |spir_func )*}}void @{{.*}}test_int_2arg
```
which we might want to remain consistent with one way or the other
https://github.com/llvm/llvm-project/pull/222160
More information about the cfe-commits
mailing list