[clang] [llvm] [HLSL][NFC] Update resource metadata tests to not use obsolete metadata annotations (PR #130222)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 6 20:04:18 PST 2025
================
@@ -0,0 +1,103 @@
+; RUN: opt -S -dxil-translate-metadata < %s | FileCheck %s
+; RUN: opt -S --passes="dxil-pretty-printer" < %s 2>&1 | FileCheck %s --check-prefix=PRINT
+; RUN: llc %s --filetype=asm -o - < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,PRINT
+
+target 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"
+target triple = "dxil-pc-shadermodel6.6-compute"
+
+%"class.hlsl::Buffer" = type { target("dx.TypedBuffer", <4 x half>, 0, 0, 0) }
+%"class.hlsl::Buffer.1" = type { target("dx.TypedBuffer", <2 x float>, 0, 0, 0) }
+%"class.hlsl::Buffer.2" = type { target("dx.TypedBuffer", double, 0, 0, 0) }
+%"class.hlsl::Buffer.3" = type { target("dx.TypedBuffer", i32, 0, 0, 1) }
+%"class.hlsl::ByteAddressBuffer" = type { target("dx.RawBuffer", i8, 0, 0) }
+%"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", i16, 0, 0) }
+%"class.hlsl::Buffer.4" = type { target("dx.TypedBuffer", i64, 0, 0, 0) }
+
+ at Zero = internal global %"class.hlsl::Buffer" poison, align 4
+ at One = internal global %"class.hlsl::Buffer.1" poison, align 4
+ at Two = internal global %"class.hlsl::Buffer.2" poison, align 4
+ at Three = internal global %"class.hlsl::Buffer.3" poison, align 4
+ at Four = internal global %"class.hlsl::ByteAddressBuffer" poison, align 4
+ at Five = internal global %"class.hlsl::StructuredBuffer" poison, align 4
+ at Six = internal global %"class.hlsl::Buffer.4" poison, align 4
+
+; PRINT:; Resource Bindings:
+; PRINT-NEXT:;
+; PRINT-NEXT:; Name Type Format Dim ID HLSL Bind Count
+; PRINT-NEXT:; ------------------------------ ---------- ------- ----------- ------- -------------- ------
+; PRINT-NEXT:; SRV f16 buf T0 t0 1
+; PRINT-NEXT:; SRV f32 buf T1 t1 1
+; PRINT-NEXT:; SRV f64 buf T2 t2 1
+; PRINT-NEXT:; SRV i32 buf T3 t3 1
+; PRINT-NEXT:; SRV byte r/o T4 t5 1
+; PRINT-NEXT:; SRV struct r/o T5 t6 1
+; PRINT-NEXT:; SRV u64 buf T6 t10,space2 1
+
+define void @test() #0 {
+ ; RWBuffer<half4> Buf : register(u0)
----------------
bogner wrote:
This isn't `RWBuffer<half4>`, it's `Buffer<half4>` - the former is a UAV. This applies to all of the RWBuffer in this file.
https://github.com/llvm/llvm-project/pull/130222
More information about the cfe-commits
mailing list