Skip to content

Conversation

hekota
Copy link
Member

@hekota hekota commented Oct 3, 2025

Refactoring methods tests for structured buffers to make it clearer that:

  • the test functions call the buffer methods and do not directly call the LLVM intrinsic
  • the buffer methods are defined after each test function
  • show what the buffer methods bodies look like
  • use buffers with different element types, not just float
  • use llvm-cxxfilt tool to de-mangle names

Refactoring structured buffer tests to make it clearer that
- the test functions call the buffer methods
- the buffer methods are defined after each test function
- show what the buffer methods bodies look like
- use buffers with different element types, not just `float`
- use `llvm-cxxfilt` tool to de-mangle names
@llvmbot llvmbot added clang Clang issues not falling into any other category HLSL HLSL Language Support labels Oct 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 3, 2025

@llvm/pr-subscribers-hlsl

Author: Helena Kotas (hekota)

Changes

Refactoring methods tests for structured buffers to make it clearer that:

  • the test functions call the buffer methods and do not directly call the LLVM intrinsic
  • the buffer methods are defined after each test function
  • show what the buffer methods bodies look like
  • use buffers with different element types, not just float
  • use llvm-cxxfilt tool to de-mangle names

Full diff: https://github.com/llvm/llvm-project/pull/161908.diff

2 Files Affected:

  • (modified) clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl (+82-34)
  • (modified) clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl (+54-20)
diff --git a/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl b/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
index 43ddd2e768ea0..a506c2b50b1dc 100644
--- a/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+++ b/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
@@ -1,64 +1,112 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL
-// RUN-DISABLED: %clang_cc1 -triple spirv-vulkan-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-SPIRV
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - %s | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,DXIL
+// RUN-DISABLED: %clang_cc1 -triple spirv-vulkan-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - %s | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,SPV
 
 // NOTE: SPIRV codegen for resource methods is not yet implemented
 
 StructuredBuffer<float> SB1 : register(t0);
 RWStructuredBuffer<float> RWSB1 : register(u0);
-RWStructuredBuffer<float> RWSB2 : register(u1);
+RWStructuredBuffer<uint4> RWSB2 : register(u1);
 AppendStructuredBuffer<float> ASB : register(u2);
-ConsumeStructuredBuffer<float> CSB : register(u3);
+ConsumeStructuredBuffer<double> CSB : register(u3);
 
-// CHECK: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", float, 0, 0) }
-// CHECK: %"class.hlsl::RWStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
-// CHECK: %"class.hlsl::AppendStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
-// CHECK: %"class.hlsl::ConsumeStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
+// DXIL: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", float, 0, 0) }
+// DXIL: %"class.hlsl::RWStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
+// DXIL: %"class.hlsl::RWStructuredBuffer.0" = type { target("dx.RawBuffer", <4 x i32>, 1, 0), target("dx.RawBuffer", <4 x i32>, 1, 0) }
+// DXIL: %"class.hlsl::AppendStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
+// DXIL: %"class.hlsl::ConsumeStructuredBuffer" = type { target("dx.RawBuffer", double, 1, 0), target("dx.RawBuffer", double, 1, 0) }
 
 export int TestIncrementCounter() {
     return RWSB1.IncrementCounter();
 }
 
-// CHECK: define noundef i32 @_Z20TestIncrementCounterv()
-// CHECK-DXIL: %[[INDEX:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 1)
-// CHECK-DXIL: ret i32 %[[INDEX]]
+// CHECK: define noundef i32 @TestIncrementCounter()()
+// CHECK: call noundef i32 @hlsl::RWStructuredBuffer<float>::IncrementCounter()(ptr {{.*}} @RWSB1)
+// CHECK: ret
+
+// CHECK: define {{.*}} noundef i32 @hlsl::RWStructuredBuffer<float>::IncrementCounter()(ptr {{.*}} %this)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
+// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
+// CHECK-NEXT:  ret i32 %[[COUNTER]]
+
 export int TestDecrementCounter() {
     return RWSB2.DecrementCounter();
 }
+// CHECK: define {{.*}} i32 @TestDecrementCounter()()
+// CHECK: call noundef i32 @hlsl::RWStructuredBuffer<unsigned int vector[4]>::DecrementCounter()(ptr {{.*}} @RWSB2)
+// CHECK: ret
 
-// CHECK: define noundef i32 @_Z20TestDecrementCounterv()
-// CHECK-DXIL: %[[INDEX:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 -1)
-// CHECK-DXIL: ret i32 %[[INDEX]]
+// CHECK: define {{.*}} noundef i32 @hlsl::RWStructuredBuffer<unsigned int vector[4]>::DecrementCounter()(ptr {{.*}} %this)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer.0", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", <4 x i32>, 1, 0), ptr %__handle, align 4
+// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_v4i32_1_0t(target("dx.RawBuffer", <4 x i32>, 1, 0) %[[HANDLE]], i8 -1)
+// CHECK-NEXT: ret i32 %[[COUNTER]]
 
 export void TestAppend(float value) {
     ASB.Append(value);
 }
 
-// CHECK: define void @_Z10TestAppendf(float noundef nofpclass(nan inf) %value)
-// CHECK-DXIL: %[[VALUE:.*]] = load float, ptr %value.addr, align 4
-// CHECK-DXIL: %[[INDEX:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 1)
-// CHECK-DXIL: %[[RESPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i32 %[[INDEX]])
-// CHECK-DXIL: store float %[[VALUE]], ptr %[[RESPTR]], align 4
+// CHECK: define void @TestAppend(float)(float {{.*}} %value)
+// CHECK: call void @hlsl::AppendStructuredBuffer<float>::Append(float)(ptr {{.*}} @ASB, float noundef nofpclass(nan inf) %0)
+// CHECK: ret void
+
+// CHECK: define {{.*}} void @hlsl::AppendStructuredBuffer<float>::Append(float)(ptr {{.*}} %this, float noundef nofpclass(nan inf) %value)
+// CHECK: %[[VALUE:.*]] = load float, ptr %value.addr
+// CHECK-NEXT: %__handle = getelementptr inbounds nuw %"class.hlsl::AppendStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
+// CHECK-NEXT: %__handle2 = getelementptr inbounds nuw %"class.hlsl::AppendStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE2:.*]] = load target("dx.RawBuffer", float, 1, 0), ptr %__handle2, align 4
+// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE2]], i8 1)
+// DXIL-NEXT: %[[PTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i32 %[[COUNTER]])
+// CHECK-NEXT: store float %[[VALUE]], ptr %[[PTR]], align 4
+// CHECK-NEXT: ret void
 
-export float TestConsume() {
+export double TestConsume() {
     return CSB.Consume();
 }
-
-// CHECK: define noundef nofpclass(nan inf) float @_Z11TestConsumev()
-// CHECK-DXIL: %[[INDEX:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %1, i8 -1)
-// CHECK-DXIL: %[[RESPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %[[INDEX]])
-// CHECK-DXIL: %[[VALUE:.*]] = load float, ptr %[[RESPTR]], align 4
-// CHECK-DXIL: ret float %[[VALUE]]
+// CHECK: define {{.*}} double @TestConsume()()
+// CHECK: call {{.*}} double @hlsl::ConsumeStructuredBuffer<double>::Consume()(ptr {{.*}} @CSB)
+// CHECK: ret double
+    
+// CHECK: define {{.*}} double @hlsl::ConsumeStructuredBuffer<double>::Consume()(ptr {{.*}} %this)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::ConsumeStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", double, 1, 0), ptr %__handle, align 4
+// CHECK-NEXT: %__handle2 = getelementptr inbounds nuw %"class.hlsl::ConsumeStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE2:.*]] = load target("dx.RawBuffer", double, 1, 0), ptr %__handle2, align 4
+// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f64_1_0t(target("dx.RawBuffer", double, 1, 0) %[[HANDLE2]], i8 -1)
+// DXIL-NEXT: %[[PTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f64_1_0t(target("dx.RawBuffer", double, 1, 0) %[[HANDLE]], i32 %[[COUNTER]])
+// CHECK-NEXT: %[[VAL:.*]] = load double, ptr %[[PTR]], align 8
+// CHECK-NEXT: ret double %[[VAL]]
 
 export float TestLoad() {
     return RWSB1.Load(1) + SB1.Load(2);
 }
 
-// CHECK: define noundef nofpclass(nan inf) float @_Z8TestLoadv()
-// CHECK: %[[PTR1:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i32 %{{[0-9]+}})
-// CHECK: %[[VALUE1:.*]] = load float, ptr %[[PTR1]]
-// CHECK: %[[PTR2:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0) %{{[0-9]+}}, i32 %{{[0-9]+}})
-// CHECK: %[[VALUE2:.*]] = load float, ptr %[[PTR2]]
+// CHECK: define noundef nofpclass(nan inf) float @TestLoad()()
+// CHECK: call {{.*}} float @hlsl::RWStructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} @RWSB1, i32 noundef 1)
+// CHECK: call {{.*}} float @hlsl::StructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} @SB1, i32 noundef 2)
+// CHECK: add
+// CHECK: ret float
+
+// CHECK: define {{.*}} float @hlsl::RWStructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} %this, i32 noundef %Index)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
+// CHECK-NEXT: %[[INDEX:.*]] = load i32, ptr %Index.addr, align 4
+// DXIL-NEXT: %[[PTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i32 %[[INDEX]])
+// CHECK-NEXT: %[[VAL:.*]] = load float, ptr %[[PTR]], align 4
+// CHECK-NEXT: ret float %[[VAL]]
+
+// CHECK: define {{.*}} float @hlsl::StructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} %this, i32 noundef %Index)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::StructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 0, 0), ptr %__handle, align 4
+// CHECK-NEXT: %[[INDEX:.*]] = load i32, ptr %Index.addr, align 4
+// DXIL-NEXT: %[[PTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0) %[[HANDLE]], i32 %[[INDEX]])
+// CHECK-NEXT: %[[VAL:.*]] = load float, ptr %[[PTR]], align 4
+// CHECK-NEXT: ret float %[[VAL]]
 
-// CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i8)
-// CHECK: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i32)
-// CHECK: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0), i32)
+// DXIL: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i8)
+// DXIL: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_v4i32_1_0t(target("dx.RawBuffer", <4 x i32>, 1, 0), i8)
+// DXIL: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i32)
+// DXIL: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f64_1_0t(target("dx.RawBuffer", double, 1, 0), i8)
+// DXIL: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f64_1_0t(target("dx.RawBuffer", double, 1, 0), i32)
+// DXIL: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0), i32)
diff --git a/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl b/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
index 9e08a6d0d7ae0..af312f9a815b8 100644
--- a/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
+++ b/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
@@ -1,37 +1,71 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-pixel -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL
-// RUN-DISABLED: %clang_cc1 -triple spirv-vulkan-pixel -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-SPIRV
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - %s | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,DXIL
+// RUN-DISABLED: %clang_cc1 -triple spirv-vulkan-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - %s | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,SPV
 
 // NOTE: SPIRV codegen for resource methods is not yet implemented
 
-RWStructuredBuffer<float> RWSB1, RWSB2;
-RasterizerOrderedStructuredBuffer<float> ROSB1, ROSB2;
+RasterizerOrderedStructuredBuffer<float> ROSB1;
+RasterizerOrderedStructuredBuffer<int2> ROSB2;
 
-// CHECK: %"class.hlsl::RWStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
+// %"class.hlsl::RasterizerOrderedStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 1), target("dx.RawBuffer", float, 1, 1) }
+// %"class.hlsl::RasterizerOrderedStructuredBuffer.0" = type { target("dx.RawBuffer", <2 x i32>, 1, 1), target("dx.RawBuffer", <2 x i32>, 1, 1) }
+
+// CHECK: @ROSB1 = internal global %"class.hlsl::RasterizerOrderedStructuredBuffer" poison
+// CHECK: @ROSB2 = internal global %"class.hlsl::RasterizerOrderedStructuredBuffer.0" poison
 
 export void TestIncrementCounter() {
-// CHECK: define void @_Z20TestIncrementCounterv()
-// CHECK-DXIL: call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 1)
-// CHECK-DXIL: call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %{{[0-9]+}}, i8 1)
-    RWSB1.IncrementCounter();
     ROSB1.IncrementCounter();
 }
 
+// CHECK: define void @TestIncrementCounter()()
+// CHECK: call noundef i32 @hlsl::RasterizerOrderedStructuredBuffer<float>::IncrementCounter()(ptr {{.*}} @ROSB1)
+// CHECK-NEXT: ret void
+
+// CHECK: define {{.*}} i32 @hlsl::RasterizerOrderedStructuredBuffer<float>::IncrementCounter()(ptr {{.*}} %this)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RasterizerOrderedStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// CHECK-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 1, 1), ptr %__handle
+// DXIL-NEXT: %[[VAL:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %[[HANDLE]], i8 1)
+// CHECK-NEXT: ret i32 %[[VAL]]
+
 export void TestDecrementCounter() {
-// CHECK: define void @_Z20TestDecrementCounterv()
-// CHECK-DXIL: call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 -1)
-// CHECK-DXIL: call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %{{[0-9]+}}, i8 -1)
-    RWSB2.DecrementCounter();
     ROSB2.DecrementCounter();
 }
 
+// CHECK: define void @TestDecrementCounter()()
+// CHECK: call noundef i32 @hlsl::RasterizerOrderedStructuredBuffer<int vector[2]>::DecrementCounter()(ptr {{.*}} @ROSB2)
+// CHECK-NEXT: ret void
+
+// CHECK: define {{.*}} i32 @hlsl::RasterizerOrderedStructuredBuffer<int vector[2]>::DecrementCounter()(ptr {{.*}} %this)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RasterizerOrderedStructuredBuffer.0", ptr %{{.*}}, i32 0, i32 0
+// CHECK-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", <2 x i32>, 1, 1), ptr %__handle
+// DXIL-NEXT: %[[VAL:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_v2i32_1_1t(target("dx.RawBuffer", <2 x i32>, 1, 1) %[[HANDLE]], i8 -1)
+// CHECK-NEXT: ret i32 %[[VAL]]
+
 export float TestLoad() {
-    return ROSB1.Load(10);
+    return ROSB1.Load(10).x + ROSB2.Load(20).x;
 }
 
-// CHECK: define noundef nofpclass(nan inf) float @_Z8TestLoadv()
-// CHECK: %[[PTR1:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %{{[0-9]+}}, i32 %{{[0-9]+}})
-// CHECK: %[[VALUE1:.*]] = load float, ptr %[[PTR1]]
+// CHECK: define {{.*}} float @TestLoad()()
+// CHECK: call {{.*}} float @hlsl::RasterizerOrderedStructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} @ROSB1, i32 noundef 10)
+// CHECK: call {{.*}} <2 x i32> @hlsl::RasterizerOrderedStructuredBuffer<int vector[2]>::Load(unsigned int)(ptr {{.*}} @ROSB2, i32 noundef 20)
+// CHECK: ret
+
+// CHECK: define {{.*}} float @hlsl::RasterizerOrderedStructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} %Index)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RasterizerOrderedStructuredBuffer", ptr {{.*}}, i32 0, i32 0
+// CHECK-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 1, 1), ptr %__handle
+// CHECK-NEXT: %[[INDEX:.*]] = load i32, ptr %Index.addr
+// DXIL-NEXT: %[[BUFPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %[[HANDLE]], i32 %[[INDEX]])
+// CHECK-NEXT: %[[VAL:.*]] = load float, ptr %[[BUFPTR]]
+// CHECK-NEXT: ret float %[[VAL]]
+
+// CHECK: define {{.*}} <2 x i32> @hlsl::RasterizerOrderedStructuredBuffer<int vector[2]>::Load(unsigned int)(ptr {{.*}} %Index)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RasterizerOrderedStructuredBuffer.0", ptr {{.*}}, i32 0, i32 0
+// CHECK-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", <2 x i32>, 1, 1), ptr %__handle
+// CHECK-NEXT: %[[INDEX:.*]] = load i32, ptr %Index.addr
+// DXIL-NEXT: %[[BUFPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_v2i32_1_1t(target("dx.RawBuffer", <2 x i32>, 1, 1) %[[HANDLE]], i32 %[[INDEX]])
+// CHECK-NEXT: %[[VAL:.*]] = load <2 x i32>, ptr %[[BUFPTR]]
+// CHECK-NEXT: ret <2 x i32> %[[VAL]]
 
-// CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i8)
-// CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i8)
-// CHECK: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i32)
+// DXIL: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i8)
+// DXIL: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_v2i32_1_1t(target("dx.RawBuffer", <2 x i32>, 1, 1), i8)
+// DXIL: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i32)
+// DXIL: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_v2i32_1_1t(target("dx.RawBuffer", <2 x i32>, 1, 1), i32)

@llvmbot
Copy link
Member

llvmbot commented Oct 3, 2025

@llvm/pr-subscribers-clang

Author: Helena Kotas (hekota)

Changes

Refactoring methods tests for structured buffers to make it clearer that:

  • the test functions call the buffer methods and do not directly call the LLVM intrinsic
  • the buffer methods are defined after each test function
  • show what the buffer methods bodies look like
  • use buffers with different element types, not just float
  • use llvm-cxxfilt tool to de-mangle names

Full diff: https://github.com/llvm/llvm-project/pull/161908.diff

2 Files Affected:

  • (modified) clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl (+82-34)
  • (modified) clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl (+54-20)
diff --git a/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl b/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
index 43ddd2e768ea0..a506c2b50b1dc 100644
--- a/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+++ b/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
@@ -1,64 +1,112 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL
-// RUN-DISABLED: %clang_cc1 -triple spirv-vulkan-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-SPIRV
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - %s | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,DXIL
+// RUN-DISABLED: %clang_cc1 -triple spirv-vulkan-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - %s | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,SPV
 
 // NOTE: SPIRV codegen for resource methods is not yet implemented
 
 StructuredBuffer<float> SB1 : register(t0);
 RWStructuredBuffer<float> RWSB1 : register(u0);
-RWStructuredBuffer<float> RWSB2 : register(u1);
+RWStructuredBuffer<uint4> RWSB2 : register(u1);
 AppendStructuredBuffer<float> ASB : register(u2);
-ConsumeStructuredBuffer<float> CSB : register(u3);
+ConsumeStructuredBuffer<double> CSB : register(u3);
 
-// CHECK: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", float, 0, 0) }
-// CHECK: %"class.hlsl::RWStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
-// CHECK: %"class.hlsl::AppendStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
-// CHECK: %"class.hlsl::ConsumeStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
+// DXIL: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", float, 0, 0) }
+// DXIL: %"class.hlsl::RWStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
+// DXIL: %"class.hlsl::RWStructuredBuffer.0" = type { target("dx.RawBuffer", <4 x i32>, 1, 0), target("dx.RawBuffer", <4 x i32>, 1, 0) }
+// DXIL: %"class.hlsl::AppendStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
+// DXIL: %"class.hlsl::ConsumeStructuredBuffer" = type { target("dx.RawBuffer", double, 1, 0), target("dx.RawBuffer", double, 1, 0) }
 
 export int TestIncrementCounter() {
     return RWSB1.IncrementCounter();
 }
 
-// CHECK: define noundef i32 @_Z20TestIncrementCounterv()
-// CHECK-DXIL: %[[INDEX:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 1)
-// CHECK-DXIL: ret i32 %[[INDEX]]
+// CHECK: define noundef i32 @TestIncrementCounter()()
+// CHECK: call noundef i32 @hlsl::RWStructuredBuffer<float>::IncrementCounter()(ptr {{.*}} @RWSB1)
+// CHECK: ret
+
+// CHECK: define {{.*}} noundef i32 @hlsl::RWStructuredBuffer<float>::IncrementCounter()(ptr {{.*}} %this)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
+// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
+// CHECK-NEXT:  ret i32 %[[COUNTER]]
+
 export int TestDecrementCounter() {
     return RWSB2.DecrementCounter();
 }
+// CHECK: define {{.*}} i32 @TestDecrementCounter()()
+// CHECK: call noundef i32 @hlsl::RWStructuredBuffer<unsigned int vector[4]>::DecrementCounter()(ptr {{.*}} @RWSB2)
+// CHECK: ret
 
-// CHECK: define noundef i32 @_Z20TestDecrementCounterv()
-// CHECK-DXIL: %[[INDEX:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 -1)
-// CHECK-DXIL: ret i32 %[[INDEX]]
+// CHECK: define {{.*}} noundef i32 @hlsl::RWStructuredBuffer<unsigned int vector[4]>::DecrementCounter()(ptr {{.*}} %this)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer.0", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", <4 x i32>, 1, 0), ptr %__handle, align 4
+// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_v4i32_1_0t(target("dx.RawBuffer", <4 x i32>, 1, 0) %[[HANDLE]], i8 -1)
+// CHECK-NEXT: ret i32 %[[COUNTER]]
 
 export void TestAppend(float value) {
     ASB.Append(value);
 }
 
-// CHECK: define void @_Z10TestAppendf(float noundef nofpclass(nan inf) %value)
-// CHECK-DXIL: %[[VALUE:.*]] = load float, ptr %value.addr, align 4
-// CHECK-DXIL: %[[INDEX:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 1)
-// CHECK-DXIL: %[[RESPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i32 %[[INDEX]])
-// CHECK-DXIL: store float %[[VALUE]], ptr %[[RESPTR]], align 4
+// CHECK: define void @TestAppend(float)(float {{.*}} %value)
+// CHECK: call void @hlsl::AppendStructuredBuffer<float>::Append(float)(ptr {{.*}} @ASB, float noundef nofpclass(nan inf) %0)
+// CHECK: ret void
+
+// CHECK: define {{.*}} void @hlsl::AppendStructuredBuffer<float>::Append(float)(ptr {{.*}} %this, float noundef nofpclass(nan inf) %value)
+// CHECK: %[[VALUE:.*]] = load float, ptr %value.addr
+// CHECK-NEXT: %__handle = getelementptr inbounds nuw %"class.hlsl::AppendStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
+// CHECK-NEXT: %__handle2 = getelementptr inbounds nuw %"class.hlsl::AppendStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE2:.*]] = load target("dx.RawBuffer", float, 1, 0), ptr %__handle2, align 4
+// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE2]], i8 1)
+// DXIL-NEXT: %[[PTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i32 %[[COUNTER]])
+// CHECK-NEXT: store float %[[VALUE]], ptr %[[PTR]], align 4
+// CHECK-NEXT: ret void
 
-export float TestConsume() {
+export double TestConsume() {
     return CSB.Consume();
 }
-
-// CHECK: define noundef nofpclass(nan inf) float @_Z11TestConsumev()
-// CHECK-DXIL: %[[INDEX:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %1, i8 -1)
-// CHECK-DXIL: %[[RESPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %[[INDEX]])
-// CHECK-DXIL: %[[VALUE:.*]] = load float, ptr %[[RESPTR]], align 4
-// CHECK-DXIL: ret float %[[VALUE]]
+// CHECK: define {{.*}} double @TestConsume()()
+// CHECK: call {{.*}} double @hlsl::ConsumeStructuredBuffer<double>::Consume()(ptr {{.*}} @CSB)
+// CHECK: ret double
+    
+// CHECK: define {{.*}} double @hlsl::ConsumeStructuredBuffer<double>::Consume()(ptr {{.*}} %this)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::ConsumeStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", double, 1, 0), ptr %__handle, align 4
+// CHECK-NEXT: %__handle2 = getelementptr inbounds nuw %"class.hlsl::ConsumeStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE2:.*]] = load target("dx.RawBuffer", double, 1, 0), ptr %__handle2, align 4
+// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f64_1_0t(target("dx.RawBuffer", double, 1, 0) %[[HANDLE2]], i8 -1)
+// DXIL-NEXT: %[[PTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f64_1_0t(target("dx.RawBuffer", double, 1, 0) %[[HANDLE]], i32 %[[COUNTER]])
+// CHECK-NEXT: %[[VAL:.*]] = load double, ptr %[[PTR]], align 8
+// CHECK-NEXT: ret double %[[VAL]]
 
 export float TestLoad() {
     return RWSB1.Load(1) + SB1.Load(2);
 }
 
-// CHECK: define noundef nofpclass(nan inf) float @_Z8TestLoadv()
-// CHECK: %[[PTR1:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i32 %{{[0-9]+}})
-// CHECK: %[[VALUE1:.*]] = load float, ptr %[[PTR1]]
-// CHECK: %[[PTR2:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0) %{{[0-9]+}}, i32 %{{[0-9]+}})
-// CHECK: %[[VALUE2:.*]] = load float, ptr %[[PTR2]]
+// CHECK: define noundef nofpclass(nan inf) float @TestLoad()()
+// CHECK: call {{.*}} float @hlsl::RWStructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} @RWSB1, i32 noundef 1)
+// CHECK: call {{.*}} float @hlsl::StructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} @SB1, i32 noundef 2)
+// CHECK: add
+// CHECK: ret float
+
+// CHECK: define {{.*}} float @hlsl::RWStructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} %this, i32 noundef %Index)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
+// CHECK-NEXT: %[[INDEX:.*]] = load i32, ptr %Index.addr, align 4
+// DXIL-NEXT: %[[PTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i32 %[[INDEX]])
+// CHECK-NEXT: %[[VAL:.*]] = load float, ptr %[[PTR]], align 4
+// CHECK-NEXT: ret float %[[VAL]]
+
+// CHECK: define {{.*}} float @hlsl::StructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} %this, i32 noundef %Index)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::StructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// DXIL-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 0, 0), ptr %__handle, align 4
+// CHECK-NEXT: %[[INDEX:.*]] = load i32, ptr %Index.addr, align 4
+// DXIL-NEXT: %[[PTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0) %[[HANDLE]], i32 %[[INDEX]])
+// CHECK-NEXT: %[[VAL:.*]] = load float, ptr %[[PTR]], align 4
+// CHECK-NEXT: ret float %[[VAL]]
 
-// CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i8)
-// CHECK: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i32)
-// CHECK: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0), i32)
+// DXIL: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i8)
+// DXIL: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_v4i32_1_0t(target("dx.RawBuffer", <4 x i32>, 1, 0), i8)
+// DXIL: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i32)
+// DXIL: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f64_1_0t(target("dx.RawBuffer", double, 1, 0), i8)
+// DXIL: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f64_1_0t(target("dx.RawBuffer", double, 1, 0), i32)
+// DXIL: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0), i32)
diff --git a/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl b/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
index 9e08a6d0d7ae0..af312f9a815b8 100644
--- a/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
+++ b/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
@@ -1,37 +1,71 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-pixel -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL
-// RUN-DISABLED: %clang_cc1 -triple spirv-vulkan-pixel -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-SPIRV
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - %s | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,DXIL
+// RUN-DISABLED: %clang_cc1 -triple spirv-vulkan-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - %s | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,SPV
 
 // NOTE: SPIRV codegen for resource methods is not yet implemented
 
-RWStructuredBuffer<float> RWSB1, RWSB2;
-RasterizerOrderedStructuredBuffer<float> ROSB1, ROSB2;
+RasterizerOrderedStructuredBuffer<float> ROSB1;
+RasterizerOrderedStructuredBuffer<int2> ROSB2;
 
-// CHECK: %"class.hlsl::RWStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }
+// %"class.hlsl::RasterizerOrderedStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 1), target("dx.RawBuffer", float, 1, 1) }
+// %"class.hlsl::RasterizerOrderedStructuredBuffer.0" = type { target("dx.RawBuffer", <2 x i32>, 1, 1), target("dx.RawBuffer", <2 x i32>, 1, 1) }
+
+// CHECK: @ROSB1 = internal global %"class.hlsl::RasterizerOrderedStructuredBuffer" poison
+// CHECK: @ROSB2 = internal global %"class.hlsl::RasterizerOrderedStructuredBuffer.0" poison
 
 export void TestIncrementCounter() {
-// CHECK: define void @_Z20TestIncrementCounterv()
-// CHECK-DXIL: call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 1)
-// CHECK-DXIL: call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %{{[0-9]+}}, i8 1)
-    RWSB1.IncrementCounter();
     ROSB1.IncrementCounter();
 }
 
+// CHECK: define void @TestIncrementCounter()()
+// CHECK: call noundef i32 @hlsl::RasterizerOrderedStructuredBuffer<float>::IncrementCounter()(ptr {{.*}} @ROSB1)
+// CHECK-NEXT: ret void
+
+// CHECK: define {{.*}} i32 @hlsl::RasterizerOrderedStructuredBuffer<float>::IncrementCounter()(ptr {{.*}} %this)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RasterizerOrderedStructuredBuffer", ptr %{{.*}}, i32 0, i32 0
+// CHECK-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 1, 1), ptr %__handle
+// DXIL-NEXT: %[[VAL:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %[[HANDLE]], i8 1)
+// CHECK-NEXT: ret i32 %[[VAL]]
+
 export void TestDecrementCounter() {
-// CHECK: define void @_Z20TestDecrementCounterv()
-// CHECK-DXIL: call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 -1)
-// CHECK-DXIL: call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %{{[0-9]+}}, i8 -1)
-    RWSB2.DecrementCounter();
     ROSB2.DecrementCounter();
 }
 
+// CHECK: define void @TestDecrementCounter()()
+// CHECK: call noundef i32 @hlsl::RasterizerOrderedStructuredBuffer<int vector[2]>::DecrementCounter()(ptr {{.*}} @ROSB2)
+// CHECK-NEXT: ret void
+
+// CHECK: define {{.*}} i32 @hlsl::RasterizerOrderedStructuredBuffer<int vector[2]>::DecrementCounter()(ptr {{.*}} %this)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RasterizerOrderedStructuredBuffer.0", ptr %{{.*}}, i32 0, i32 0
+// CHECK-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", <2 x i32>, 1, 1), ptr %__handle
+// DXIL-NEXT: %[[VAL:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_v2i32_1_1t(target("dx.RawBuffer", <2 x i32>, 1, 1) %[[HANDLE]], i8 -1)
+// CHECK-NEXT: ret i32 %[[VAL]]
+
 export float TestLoad() {
-    return ROSB1.Load(10);
+    return ROSB1.Load(10).x + ROSB2.Load(20).x;
 }
 
-// CHECK: define noundef nofpclass(nan inf) float @_Z8TestLoadv()
-// CHECK: %[[PTR1:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %{{[0-9]+}}, i32 %{{[0-9]+}})
-// CHECK: %[[VALUE1:.*]] = load float, ptr %[[PTR1]]
+// CHECK: define {{.*}} float @TestLoad()()
+// CHECK: call {{.*}} float @hlsl::RasterizerOrderedStructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} @ROSB1, i32 noundef 10)
+// CHECK: call {{.*}} <2 x i32> @hlsl::RasterizerOrderedStructuredBuffer<int vector[2]>::Load(unsigned int)(ptr {{.*}} @ROSB2, i32 noundef 20)
+// CHECK: ret
+
+// CHECK: define {{.*}} float @hlsl::RasterizerOrderedStructuredBuffer<float>::Load(unsigned int)(ptr {{.*}} %Index)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RasterizerOrderedStructuredBuffer", ptr {{.*}}, i32 0, i32 0
+// CHECK-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", float, 1, 1), ptr %__handle
+// CHECK-NEXT: %[[INDEX:.*]] = load i32, ptr %Index.addr
+// DXIL-NEXT: %[[BUFPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %[[HANDLE]], i32 %[[INDEX]])
+// CHECK-NEXT: %[[VAL:.*]] = load float, ptr %[[BUFPTR]]
+// CHECK-NEXT: ret float %[[VAL]]
+
+// CHECK: define {{.*}} <2 x i32> @hlsl::RasterizerOrderedStructuredBuffer<int vector[2]>::Load(unsigned int)(ptr {{.*}} %Index)
+// CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RasterizerOrderedStructuredBuffer.0", ptr {{.*}}, i32 0, i32 0
+// CHECK-NEXT: %[[HANDLE:.*]] = load target("dx.RawBuffer", <2 x i32>, 1, 1), ptr %__handle
+// CHECK-NEXT: %[[INDEX:.*]] = load i32, ptr %Index.addr
+// DXIL-NEXT: %[[BUFPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_v2i32_1_1t(target("dx.RawBuffer", <2 x i32>, 1, 1) %[[HANDLE]], i32 %[[INDEX]])
+// CHECK-NEXT: %[[VAL:.*]] = load <2 x i32>, ptr %[[BUFPTR]]
+// CHECK-NEXT: ret <2 x i32> %[[VAL]]
 
-// CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i8)
-// CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i8)
-// CHECK: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i32)
+// DXIL: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i8)
+// DXIL: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_v2i32_1_1t(target("dx.RawBuffer", <2 x i32>, 1, 1), i8)
+// DXIL: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i32)
+// DXIL: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_v2i32_1_1t(target("dx.RawBuffer", <2 x i32>, 1, 1), i32)

@hekota hekota changed the title [HLSL][NFC] Refactor for structured buffer methods tests [HLSL][NFC] Refactor structured buffer methods tests Oct 3, 2025
@bob80905
Copy link
Contributor

bob80905 commented Oct 3, 2025

Your tests don't make use of the SPV filecheck prefix. Is there output that's only visible when targeting DXIL?

@hekota
Copy link
Member Author

hekota commented Oct 6, 2025

Your tests don't make use of the SPV filecheck prefix. Is there output that's only visible when targeting DXIL?

Yes, anytime the codegen emits @llvm.dx.resource* intrinsic that is just for DXIL. The SPIR-V tests are not enabled (or implemented yet), that's why there is no SPV prefix use yet. The intention is that this test should eventually be run for both DXIL and SPIRV.

// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - %s | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,DXIL
// RUN-DISABLED: %clang_cc1 -triple spirv-vulkan-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - %s | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,SPV

// NOTE: SPIRV codegen for resource methods is not yet implemented
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these should all work for Spirv now. We can follow up with another PR adding the SPV checks.

Copy link
Contributor

@bogner bogner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally good. One comment about check prefixes you can take or leave.

@hekota hekota merged commit 511c1f9 into llvm:main Oct 14, 2025
9 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-sie-ubuntu-fast running on sie-linux-worker while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/37831

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl | llvm-cxxfilt | /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ llvm-cxxfilt
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL
�[1m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl:29:15: �[0m�[0;1;31merror: �[0m�[1mDXIL-NEXT: expected string not found in input
�[0m// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
�[0;1;32m              ^
�[0m�[1m<stdin>:336:62: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0m %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
�[0;1;32m                                                             ^
�[0m�[1m<stdin>:336:62: �[0m�[0;1;30mnote: �[0m�[1mwith "HANDLE" equal to "0"
�[0m %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
�[0;1;32m                                                             ^
�[0m�[1m<stdin>:338:2: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1)
�[0;1;32m ^
�[0m
Input file: <stdin>
Check file: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
�[1m�[0m�[0;1;30m           1: �[0m�[1m�[0;1;46m; ModuleID = '/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' �[0m
�[0;1;30m           2: �[0m�[1m�[0;1;46msource_filename = "/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl" �[0m
�[0;1;30m           3: �[0m�[1m�[0;1;46mtarget datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" �[0m
�[0;1;30m           4: �[0m�[1m�[0;1;46mtarget triple = "dxilv1.3-pc-shadermodel6.3-library" �[0m
�[0;1;30m           5: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m           6: �[0m�[1m�[0;1;46m�[0m%"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", float, 0, 0) }�[0;1;46m �[0m
�[0;1;32mcheck:12      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m           7: �[0m�[1m�[0;1;46m�[0m%"class.hlsl::RWStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }�[0;1;46m �[0m
�[0;1;32mcheck:13      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m           8: �[0m�[1m�[0;1;46m�[0m%"class.hlsl::RWStructuredBuffer.0" = type { target("dx.RawBuffer", <4 x i32>, 1, 0), target("dx.RawBuffer", <4 x i32>, 1, 0) }�[0;1;46m �[0m
�[0;1;32mcheck:14      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m           9: �[0m�[1m�[0;1;46m�[0m%"class.hlsl::AppendStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0), target("dx.RawBuffer", float, 1, 0) }�[0;1;46m �[0m
�[0;1;32mcheck:15      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          10: �[0m�[1m�[0;1;46m�[0m%"class.hlsl::ConsumeStructuredBuffer" = type { target("dx.RawBuffer", double, 1, 0), target("dx.RawBuffer", double, 1, 0) }�[0;1;46m �[0m
�[0;1;32mcheck:16      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          11: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m          12: �[0m�[1m�[0;1;46m@SB1 = internal global %"class.hlsl::StructuredBuffer" poison, align 4 �[0m
�[0;1;30m          13: �[0m�[1m�[0;1;[email protected] = private unnamed_addr constant [4 x i8] c"SB1\00", align 1 �[0m
�[0;1;30m          14: �[0m�[1m�[0;1;46m@RWSB1 = internal global %"class.hlsl::RWStructuredBuffer" poison, align 4 �[0m
�[0;1;30m          15: �[0m�[1m�[0;1;[email protected] = private unnamed_addr constant [6 x i8] c"RWSB1\00", align 1 �[0m
�[0;1;30m          16: �[0m�[1m�[0;1;46m@RWSB2 = internal global %"class.hlsl::RWStructuredBuffer.0" poison, align 4 �[0m
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder clang-m68k-linux-cross running on suse-gary-m68k-cross while building clang at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/17513

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/bin/clang -cc1 -internal-isystem /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl | llvm-cxxfilt | /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/bin/FileCheck /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/bin/clang -cc1 -internal-isystem /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+ /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/bin/FileCheck /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL
+ llvm-cxxfilt
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl:29:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
              ^
<stdin>:336:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:336:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:338:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         331:  %Index.addr = alloca i32, align 4 
         332:  store ptr %this, ptr %this.addr, align 4 
         333:  store i32 %Index, ptr %Index.addr, align 4 
         334:  %this1 = load ptr, ptr %this.addr, align 4 
         335:  %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %this1, i32 0, i32 0 
         336:  %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4 
next:29'0                                                                  X~~~~~~~~~ error: no match found
next:29'1                                                                             with "HANDLE" equal to "0"
         337:  %1 = load i32, ptr %Index.addr, align 4 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         338:  %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1) 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:29'2      ?                                                                                                                     possible intended match
         339:  %3 = load float, ptr %2, align 4 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         340:  ret float %3 
next:29'0     ~~~~~~~~~~~~~~
         341: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder arc-builder running on arc-worker while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/3/builds/23421

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/buildbot/worker/arc-folder/build/bin/clang -cc1 -internal-isystem /buildbot/worker/arc-folder/build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /buildbot/worker/arc-folder/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl | llvm-cxxfilt | /buildbot/worker/arc-folder/build/bin/FileCheck /buildbot/worker/arc-folder/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ /buildbot/worker/arc-folder/build/bin/FileCheck /buildbot/worker/arc-folder/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL
+ /buildbot/worker/arc-folder/build/bin/clang -cc1 -internal-isystem /buildbot/worker/arc-folder/build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /buildbot/worker/arc-folder/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+ llvm-cxxfilt
/buildbot/worker/arc-folder/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl:29:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
              ^
<stdin>:336:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:336:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:338:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /buildbot/worker/arc-folder/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         331:  %Index.addr = alloca i32, align 4 
         332:  store ptr %this, ptr %this.addr, align 4 
         333:  store i32 %Index, ptr %Index.addr, align 4 
         334:  %this1 = load ptr, ptr %this.addr, align 4 
         335:  %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %this1, i32 0, i32 0 
         336:  %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4 
next:29'0                                                                  X~~~~~~~~~ error: no match found
next:29'1                                                                             with "HANDLE" equal to "0"
         337:  %1 = load i32, ptr %Index.addr, align 4 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         338:  %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1) 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:29'2      ?                                                                                                                     possible intended match
         339:  %3 = load float, ptr %2, align 4 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         340:  ret float %3 
next:29'0     ~~~~~~~~~~~~~~
         341: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime-2 running on rocm-worker-hw-02 while building clang at step 7 "Add check check-clang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/15438

Here is the relevant piece of the build log for the reference
Step 7 (Add check check-clang) failure: test (failure)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang -cc1 -internal-isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl | llvm-cxxfilt | /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ llvm-cxxfilt
+ /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang -cc1 -internal-isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
+ /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl --check-prefixes=CHECK,DXIL
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl:26:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[VAL:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %[[HANDLE]], i8 1)
              ^
<stdin>:165:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 1), ptr %__handle, align 4
                                                             ^
<stdin>:165:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 1), ptr %__handle, align 4
                                                             ^
<stdin>:167:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         160:  %Index.addr = alloca i32, align 4 
         161:  store ptr %this, ptr %this.addr, align 4 
         162:  store i32 %Index, ptr %Index.addr, align 4 
         163:  %this1 = load ptr, ptr %this.addr, align 4 
         164:  %__handle = getelementptr inbounds nuw %"class.hlsl::RasterizerOrderedStructuredBuffer", ptr %this1, i32 0, i32 0 
         165:  %0 = load target("dx.RawBuffer", float, 1, 1), ptr %__handle, align 4 
next:26'0                                                                  X~~~~~~~~~ error: no match found
next:26'1                                                                             with "HANDLE" equal to "0"
         166:  %1 = load i32, ptr %Index.addr, align 4 
next:26'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         167:  %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %0, i32 %1) 
next:26'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:26'2      ?                                                                                                                     possible intended match
         168:  %3 = load float, ptr %2, align 4 
next:26'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         169:  ret float %3 
next:26'0     ~~~~~~~~~~~~~~
         170: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-aarch64-darwin running on doug-worker-5 while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/29046

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/Volumes/ExternalSSD/buildbot-root/aarch64-darwin/build/bin/clang -cc1 -internal-isystem /Volumes/ExternalSSD/buildbot-root/aarch64-darwin/build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /Users/buildbot/buildbot-root2/aarch64-darwin/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl | llvm-cxxfilt | /Volumes/ExternalSSD/buildbot-root/aarch64-darwin/build/bin/FileCheck /Users/buildbot/buildbot-root2/aarch64-darwin/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ /Volumes/ExternalSSD/buildbot-root/aarch64-darwin/build/bin/clang -cc1 -internal-isystem /Volumes/ExternalSSD/buildbot-root/aarch64-darwin/build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /Users/buildbot/buildbot-root2/aarch64-darwin/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+ llvm-cxxfilt
+ /Volumes/ExternalSSD/buildbot-root/aarch64-darwin/build/bin/FileCheck /Users/buildbot/buildbot-root2/aarch64-darwin/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL
/Users/buildbot/buildbot-root2/aarch64-darwin/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl:29:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
              ^
<stdin>:336:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:336:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:338:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /Users/buildbot/buildbot-root2/aarch64-darwin/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         331:  %Index.addr = alloca i32, align 4 
         332:  store ptr %this, ptr %this.addr, align 4 
         333:  store i32 %Index, ptr %Index.addr, align 4 
         334:  %this1 = load ptr, ptr %this.addr, align 4 
         335:  %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %this1, i32 0, i32 0 
         336:  %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4 
next:29'0                                                                  X~~~~~~~~~ error: no match found
next:29'1                                                                             with "HANDLE" equal to "0"
         337:  %1 = load i32, ptr %Index.addr, align 4 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         338:  %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1) 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:29'2      ?                                                                                                                     possible intended match
         339:  %3 = load float, ptr %2, align 4 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         340:  ret float %3 
next:29'0     ~~~~~~~~~~~~~~
         341: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-gcc-ubuntu running on sie-linux-worker3 while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/26009

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl | llvm-cxxfilt | /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/bin/clang -cc1 -internal-isystem /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl --check-prefixes=CHECK,DXIL
+ llvm-cxxfilt
�[1m/home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl:26:15: �[0m�[0;1;31merror: �[0m�[1mDXIL-NEXT: expected string not found in input
�[0m// DXIL-NEXT: %[[VAL:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %[[HANDLE]], i8 1)
�[0;1;32m              ^
�[0m�[1m<stdin>:165:62: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0m %0 = load target("dx.RawBuffer", float, 1, 1), ptr %__handle, align 4
�[0;1;32m                                                             ^
�[0m�[1m<stdin>:165:62: �[0m�[0;1;30mnote: �[0m�[1mwith "HANDLE" equal to "0"
�[0m %0 = load target("dx.RawBuffer", float, 1, 1), ptr %__handle, align 4
�[0;1;32m                                                             ^
�[0m�[1m<stdin>:167:2: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %0, i32 %1)
�[0;1;32m ^
�[0m
Input file: <stdin>
Check file: /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
�[1m�[0m�[0;1;30m           1: �[0m�[1m�[0;1;46m; ModuleID = '/home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl' �[0m
�[0;1;30m           2: �[0m�[1m�[0;1;46msource_filename = "/home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl" �[0m
�[0;1;30m           3: �[0m�[1m�[0;1;46mtarget datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" �[0m
�[0;1;30m           4: �[0m�[1m�[0;1;46mtarget triple = "dxilv1.3-pc-shadermodel6.3-pixel" �[0m
�[0;1;30m           5: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m           6: �[0m�[1m�[0;1;46m%"class.hlsl::RasterizerOrderedStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 1), target("dx.RawBuffer", float, 1, 1) } �[0m
�[0;1;30m           7: �[0m�[1m�[0;1;46m%"class.hlsl::RasterizerOrderedStructuredBuffer.0" = type { target("dx.RawBuffer", <2 x i32>, 1, 1), target("dx.RawBuffer", <2 x i32>, 1, 1) } �[0m
�[0;1;30m           8: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m           9: �[0m�[1m�[0;1;46m�[0m@ROSB1 = internal global %"class.hlsl::RasterizerOrderedStructuredBuffer" poison�[0;1;46m, align 4 �[0m
�[0;1;32mcheck:12      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          10: �[0m�[1m�[0;1;[email protected] = private unnamed_addr constant [6 x i8] c"ROSB1\00", align 1 �[0m
�[0;1;30m          11: �[0m�[1m�[0;1;46m�[0m@ROSB2 = internal global %"class.hlsl::RasterizerOrderedStructuredBuffer.0" poison�[0;1;46m, align 4 �[0m
�[0;1;32mcheck:13      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          12: �[0m�[1m�[0;1;[email protected] = private unnamed_addr constant [6 x i8] c"ROSB2\00", align 1 �[0m
�[0;1;30m          13: �[0m�[1m�[0;1;46m �[0m
�[0;1;30m          14: �[0m�[1m�[0;1;46m; Function Attrs: alwaysinline convergent nounwind �[0m
�[0;1;30m          15: �[0m�[1m�[0;1;46mdefine internal void @__cxx_global_var_init() #0 { �[0m
�[0;1;30m          16: �[0m�[1m�[0;1;46mentry: �[0m
�[0;1;30m          17: �[0m�[1m�[0;1;46m call void @hlsl::RasterizerOrderedStructuredBuffer<float>::__createFromImplicitBindingWithImplicitCounter(unsigned int, unsigned int, int, unsigned int, char const*, unsigned int)(ptr dead_on_unwind writable sret(%"class.hlsl::RasterizerOrderedStructuredBuffer") align 4 @ROSB1, i32 noundef 0, i32 noundef 0, i32 noundef 1, i32 noundef 0, ptr noundef @.str, i32 noundef 1) #4 �[0m
�[0;1;30m          18: �[0m�[1m�[0;1;46m ret void �[0m
�[0;1;30m          19: �[0m�[1m�[0;1;46m} �[0m
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-sie-win running on sie-win-worker while building clang at step 4 "clean-build-dir".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/46/builds/24857

Here is the relevant piece of the build log for the reference
Step 4 (clean-build-dir) failure: Delete failed. (failure)
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
z:\b\llvm-clang-x86_64-sie-win\build\bin\clang.exe -cc1 -internal-isystem Z:\b\llvm-clang-x86_64-sie-win\build\lib\clang\22\include -nostdsysteminc -triple dxil-pc-shadermodel6.3-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGenHLSL\resources\StructuredBuffers-methods-ps.hlsl | llvm-cxxfilt | z:\b\llvm-clang-x86_64-sie-win\build\bin\filecheck.exe Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGenHLSL\resources\StructuredBuffers-methods-ps.hlsl --check-prefixes=CHECK,DXIL
# executed command: 'z:\b\llvm-clang-x86_64-sie-win\build\bin\clang.exe' -cc1 -internal-isystem 'Z:\b\llvm-clang-x86_64-sie-win\build\lib\clang\22\include' -nostdsysteminc -triple dxil-pc-shadermodel6.3-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - 'Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGenHLSL\resources\StructuredBuffers-methods-ps.hlsl'
# note: command had no output on stdout or stderr
# executed command: llvm-cxxfilt
# note: command had no output on stdout or stderr
# executed command: 'z:\b\llvm-clang-x86_64-sie-win\build\bin\filecheck.exe' 'Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGenHLSL\resources\StructuredBuffers-methods-ps.hlsl' --check-prefixes=CHECK,DXIL
# .---command stderr------------
# | �[1mZ:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGenHLSL\resources\StructuredBuffers-methods-ps.hlsl:26:15: �[0m�[0;1;31merror: �[0m�[1mDXIL-NEXT: expected string not found in input
�[0m# | �[1m�[0m// DXIL-NEXT: %[[VAL:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %[[HANDLE]], i8 1)
# | �[0;1;32m              ^
�[0m# | �[0;1;32m�[0m�[1m<stdin>:165:62: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0m# | �[1m�[0m %0 = load target("dx.RawBuffer", float, 1, 1), ptr %__handle, align 4
# | �[0;1;32m                                                             ^
�[0m# | �[0;1;32m�[0m�[1m<stdin>:165:62: �[0m�[0;1;30mnote: �[0m�[1mwith "HANDLE" equal to "0"
�[0m# | �[1m�[0m %0 = load target("dx.RawBuffer", float, 1, 1), ptr %__handle, align 4
# | �[0;1;32m                                                             ^
�[0m# | �[0;1;32m�[0m�[1m<stdin>:167:2: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m# | �[1m�[0m %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %0, i32 %1)
# | �[0;1;32m ^
�[0m# | �[0;1;32m�[0m
# | Input file: <stdin>
# | Check file: Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGenHLSL\resources\StructuredBuffers-methods-ps.hlsl
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# | �[1m�[0m�[0;1;30m           1: �[0m�[1m�[0;1;46m; ModuleID = 'Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\test\CodeGenHLSL\resources\StructuredBuffers-methods-ps.hlsl' �[0m
# | �[0;1;30m           2: �[0m�[1m�[0;1;46msource_filename = "Z:\\b\\llvm-clang-x86_64-sie-win\\llvm-project\\clang\\test\\CodeGenHLSL\\resources\\StructuredBuffers-methods-ps.hlsl" �[0m
# | �[0;1;30m           3: �[0m�[1m�[0;1;46mtarget datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" �[0m
# | �[0;1;30m           4: �[0m�[1m�[0;1;46mtarget triple = "dxilv1.3-pc-shadermodel6.3-pixel" �[0m
# | �[0;1;30m           5: �[0m�[1m�[0;1;46m �[0m
# | �[0;1;30m           6: �[0m�[1m�[0;1;46m%"class.hlsl::RasterizerOrderedStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 1), target("dx.RawBuffer", float, 1, 1) } �[0m
# | �[0;1;30m           7: �[0m�[1m�[0;1;46m%"class.hlsl::RasterizerOrderedStructuredBuffer.0" = type { target("dx.RawBuffer", <2 x i32>, 1, 1), target("dx.RawBuffer", <2 x i32>, 1, 1) } �[0m
# | �[0;1;30m           8: �[0m�[1m�[0;1;46m �[0m
# | �[0;1;30m           9: �[0m�[1m�[0;1;46m�[0m@ROSB1 = internal global %"class.hlsl::RasterizerOrderedStructuredBuffer" poison�[0;1;46m, align 4 �[0m
# | �[0;1;32mcheck:12      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m# | �[0;1;32m�[0m�[0;1;30m          10: �[0m�[1m�[0;1;[email protected] = private unnamed_addr constant [6 x i8] c"ROSB1\00", align 1 �[0m
# | �[0;1;30m          11: �[0m�[1m�[0;1;46m�[0m@ROSB2 = internal global %"class.hlsl::RasterizerOrderedStructuredBuffer.0" poison�[0;1;46m, align 4 �[0m
# | �[0;1;32mcheck:13      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m# | �[0;1;32m�[0m�[0;1;30m          12: �[0m�[1m�[0;1;[email protected] = private unnamed_addr constant [6 x i8] c"ROSB2\00", align 1 �[0m
# | �[0;1;30m          13: �[0m�[1m�[0;1;46m �[0m
# | �[0;1;30m          14: �[0m�[1m�[0;1;46m; Function Attrs: alwaysinline convergent nounwind �[0m
# | �[0;1;30m          15: �[0m�[1m�[0;1;46mdefine internal void @__cxx_global_var_init() #0 { �[0m
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-sles-build-only running on rocm-worker-hw-04-sles while building clang at step 6 "Add check check-clang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/32425

Here is the relevant piece of the build log for the reference
Step 6 (Add check check-clang) failure: test (failure)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/clang -cc1 -internal-isystem /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl | llvm-cxxfilt | /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/FileCheck /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/FileCheck /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL
+ llvm-cxxfilt
+ /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/clang -cc1 -internal-isystem /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl:29:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
              ^
<stdin>:336:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:336:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:338:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         331:  %Index.addr = alloca i32, align 4 
         332:  store ptr %this, ptr %this.addr, align 4 
         333:  store i32 %Index, ptr %Index.addr, align 4 
         334:  %this1 = load ptr, ptr %this.addr, align 4 
         335:  %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %this1, i32 0, i32 0 
         336:  %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4 
next:29'0                                                                  X~~~~~~~~~ error: no match found
next:29'1                                                                             with "HANDLE" equal to "0"
         337:  %1 = load i32, ptr %Index.addr, align 4 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         338:  %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1) 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:29'2      ?                                                                                                                     possible intended match
         339:  %3 = load float, ptr %2, align 4 
next:29'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         340:  ret float %3 
next:29'0     ~~~~~~~~~~~~~~
         341: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder clang-debian-cpp20 running on clang-debian-cpp20 while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/108/builds/18744

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/clang -cc1 -internal-isystem /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl | llvm-cxxfilt | /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/FileCheck /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/clang -cc1 -internal-isystem /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-pixel -finclude-default-header -emit-llvm -disable-llvm-passes -o - /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl
+ llvm-cxxfilt
+ /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/FileCheck /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl --check-prefixes=CHECK,DXIL
/vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl:26:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[VAL:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %[[HANDLE]], i8 1)
              ^
<stdin>:165:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 1), ptr %__handle, align 4
                                                             ^
<stdin>:165:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 1), ptr %__handle, align 4
                                                             ^
<stdin>:167:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-ps.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         160:  %Index.addr = alloca i32, align 4 
         161:  store ptr %this, ptr %this.addr, align 4 
         162:  store i32 %Index, ptr %Index.addr, align 4 
         163:  %this1 = load ptr, ptr %this.addr, align 4 
         164:  %__handle = getelementptr inbounds nuw %"class.hlsl::RasterizerOrderedStructuredBuffer", ptr %this1, i32 0, i32 0 
         165:  %0 = load target("dx.RawBuffer", float, 1, 1), ptr %__handle, align 4 
next:26'0                                                                  X~~~~~~~~~ error: no match found
next:26'1                                                                             with "HANDLE" equal to "0"
         166:  %1 = load i32, ptr %Index.addr, align 4 
next:26'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         167:  %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %0, i32 %1) 
next:26'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:26'2      ?                                                                                                                     possible intended match
         168:  %3 = load float, ptr %2, align 4 
next:26'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         169:  ret float %3 
next:26'0     ~~~~~~~~~~~~~~
         170: } 
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-a-1 while building clang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/26007

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[857/1445] Running the Clang regression tests
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using clang: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/clang
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find cir-opt in /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find clang-repl in /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/ld.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/lld-link
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/ld64.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/wasm-ld
-- Testing: 22734 tests, 60 workers --
Testing:  0.. 10.. 20.. 30.. 40
FAIL: Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl (10293 of 22734)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/clang -cc1 -internal-isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl | llvm-cxxfilt | /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/FileCheck /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ llvm-cxxfilt
+ /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/clang -cc1 -internal-isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+ /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/FileCheck /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl:29:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
              ^
<stdin>:336:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:336:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:338:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         331:  %Index.addr = alloca i32, align 4 
         332:  store ptr %this, ptr %this.addr, align 4 
         333:  store i32 %Index, ptr %Index.addr, align 4 
         334:  %this1 = load ptr, ptr %this.addr, align 4 
         335:  %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %this1, i32 0, i32 0 
         336:  %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4 
Step 7 (check) failure: check (failure)
...
[857/1445] Running the Clang regression tests
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using clang: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/clang
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find cir-opt in /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find clang-repl in /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/ld.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/lld-link
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/ld64.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/wasm-ld
-- Testing: 22734 tests, 60 workers --
Testing:  0.. 10.. 20.. 30.. 40
FAIL: Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl (10293 of 22734)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/clang -cc1 -internal-isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl | llvm-cxxfilt | /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/FileCheck /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ llvm-cxxfilt
+ /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/clang -cc1 -internal-isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+ /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-f_hlgg_v/bin/FileCheck /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl:29:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
              ^
<stdin>:336:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:336:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:338:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         331:  %Index.addr = alloca i32, align 4 
         332:  store ptr %this, ptr %this.addr, align 4 
         333:  store i32 %Index, ptr %Index.addr, align 4 
         334:  %this1 = load ptr, ptr %this.addr, align 4 
         335:  %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %this1, i32 0, i32 0 
         336:  %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4 

@Kewen12
Copy link
Contributor

Kewen12 commented Oct 14, 2025

Hi, this PR breaks many bots. Could you please fix it or revert if it needs more investigation? Thanks!

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 14, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-bootstrap-msan running on sanitizer-buildbot5 while building clang at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/164/builds/14485

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 92673 tests, 64 workers --
Testing:  0.. 
FAIL: Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl (10328 of 92673)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang -cc1 -internal-isystem /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl | llvm-cxxfilt | /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang -cc1 -internal-isystem /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL
+ llvm-cxxfilt
/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl:29:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
              ^
<stdin>:336:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:336:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:338:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         331:  %Index.addr = alloca i32, align 4 
         332:  store ptr %this, ptr %this.addr, align 4 
         333:  store i32 %Index, ptr %Index.addr, align 4 
         334:  %this1 = load ptr, ptr %this.addr, align 4 
         335:  %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %this1, i32 0, i32 0 
         336:  %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4 
Step 11 (stage2/msan check) failure: stage2/msan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 92673 tests, 64 workers --
Testing:  0.. 
FAIL: Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl (10328 of 92673)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang -cc1 -internal-isystem /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl | llvm-cxxfilt | /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang -cc1 -internal-isystem /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL
+ llvm-cxxfilt
/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl:29:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
              ^
<stdin>:336:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:336:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:338:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         331:  %Index.addr = alloca i32, align 4 
         332:  store ptr %this, ptr %this.addr, align 4 
         333:  store i32 %Index, ptr %Index.addr, align 4 
         334:  %this1 = load ptr, ptr %this.addr, align 4 
         335:  %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %this1, i32 0, i32 0 
         336:  %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4 
Step 14 (stage3/msan check) failure: stage3/msan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 89373 tests, 64 workers --
Testing:  0.. 
FAIL: Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl (10324 of 89373)
******************** TEST 'Clang :: CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/clang -cc1 -internal-isystem /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl | llvm-cxxfilt | /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL # RUN: at line 1
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl --check-prefixes=CHECK,DXIL
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/bin/clang -cc1 -internal-isystem /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build2_msan/lib/clang/22/include -nostdsysteminc -triple dxil-pc-shadermodel6.3-library -finclude-default-header -emit-llvm -disable-llvm-passes -o - /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl
+ llvm-cxxfilt
/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl:29:15: error: DXIL-NEXT: expected string not found in input
// DXIL-NEXT: %[[COUNTER:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %[[HANDLE]], i8 1)
              ^
<stdin>:336:62: note: scanning from here
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:336:62: note: with "HANDLE" equal to "0"
 %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4
                                                             ^
<stdin>:338:2: note: possible intended match here
 %2 = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %1)
 ^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/CodeGenHLSL/resources/StructuredBuffers-methods-lib.hlsl

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         331:  %Index.addr = alloca i32, align 4 
         332:  store ptr %this, ptr %this.addr, align 4 
         333:  store i32 %Index, ptr %Index.addr, align 4 
         334:  %this1 = load ptr, ptr %this.addr, align 4 
         335:  %__handle = getelementptr inbounds nuw %"class.hlsl::RWStructuredBuffer", ptr %this1, i32 0, i32 0 
         336:  %0 = load target("dx.RawBuffer", float, 1, 0), ptr %__handle, align 4 

@hekota
Copy link
Member Author

hekota commented Oct 14, 2025

Hi, this PR breaks many bots. Could you please fix it or revert if it needs more investigation? Thanks!

Thanks! I'll revert it.

hekota added a commit to hekota/llvm-project that referenced this pull request Oct 14, 2025
@hekota
Copy link
Member Author

hekota commented Oct 14, 2025

Revert PR: #163472

hekota added a commit that referenced this pull request Oct 14, 2025
hekota added a commit to hekota/llvm-project that referenced this pull request Oct 15, 2025
Refactoring methods tests for structured buffers to make it clearer that:
- the test functions call the buffer methods and do not directly call the LLVM intrinsic
- the buffer methods are defined after each test function
- show what the buffer methods bodies look like
- use buffers with different element types, not just `float`
- use `llvm-cxxfilt` tool to de-mangle names

(cherry picked from commit 511c1f9)
hekota added a commit that referenced this pull request Oct 16, 2025
…163605)

Refactoring methods tests for structured buffers to make it clearer that:
- the test functions call the buffer methods and do not directly call the LLVM intrinsic
- the buffer methods are defined after each test function
- show what the buffer methods bodies look like
- use buffers with different element types, not just `float`
- use `llvm-cxxfilt` tool to de-mangle names

This is a second attempt to land this. Previous [PR](#161908) broke the build
because the test baselines did not reflect the introduction of counter handles since its validation build.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Oct 16, 2025
… attempt (#163605)

Refactoring methods tests for structured buffers to make it clearer that:
- the test functions call the buffer methods and do not directly call the LLVM intrinsic
- the buffer methods are defined after each test function
- show what the buffer methods bodies look like
- use buffers with different element types, not just `float`
- use `llvm-cxxfilt` tool to de-mangle names

This is a second attempt to land this. Previous [PR](llvm/llvm-project#161908) broke the build
because the test baselines did not reflect the introduction of counter handles since its validation build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category HLSL HLSL Language Support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants