68 lines · plain
1; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s2; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC3 4; This test makes sure that the shader flag '64 UAV slots' is set when there are5; more than 8 UAVs in the module.6 7target triple = "dxil-pc-shadermodel6.7-library"8 9; CHECK: Combined Shader Flags for Module10; CHECK-NEXT: Shader Flags Value: 0x0000800011 12; CHECK: Note: shader requires additional functionality:13; CHECK: 64 UAV slots14 15; Note: 64 UAV slots does not get set per-function16; CHECK: Function test : 0x0000800017define void @test() "hlsl.export" {18 ; RWBuffer<float> Buf : register(u0, space0)19 %buf0 = call target("dx.TypedBuffer", float, 1, 0, 1)20 @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0t(21 i32 0, i32 0, i32 1, i32 0, ptr null)22 ; RWBuffer<float> Buf : register(u1, space0)23 %buf1 = call target("dx.TypedBuffer", float, 1, 0, 1)24 @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0t(25 i32 0, i32 1, i32 1, i32 0, ptr null)26 ; RWBuffer<float> Buf : register(u2, space0)27 %buf2 = call target("dx.TypedBuffer", float, 1, 0, 1)28 @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0t(29 i32 0, i32 2, i32 1, i32 0, ptr null)30 ; RWBuffer<float> Buf : register(u3, space0)31 %buf3 = call target("dx.TypedBuffer", float, 1, 0, 1)32 @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0t(33 i32 0, i32 3, i32 1, i32 0, ptr null)34 ; RWBuffer<float> Buf : register(u4, space0)35 %buf4 = call target("dx.TypedBuffer", float, 1, 0, 1)36 @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0t(37 i32 0, i32 4, i32 1, i32 0, ptr null)38 ; RWBuffer<float> Buf : register(u5, space0)39 %buf5 = call target("dx.TypedBuffer", float, 1, 0, 1)40 @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0t(41 i32 0, i32 5, i32 1, i32 0, ptr null)42 ; RWBuffer<float> Buf : register(u6, space0)43 %buf6 = call target("dx.TypedBuffer", float, 1, 0, 1)44 @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0t(45 i32 0, i32 6, i32 1, i32 0, ptr null)46 ; RWBuffer<float> Buf : register(u7, space0)47 %buf7 = call target("dx.TypedBuffer", float, 1, 0, 1)48 @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0t(49 i32 0, i32 7, i32 1, i32 0, ptr null)50 ; RWBuffer<float> Buf : register(u8, space0)51 %buf8 = call target("dx.TypedBuffer", float, 1, 0, 1)52 @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0t(53 i32 0, i32 8, i32 1, i32 0, ptr null)54 ret void55}56 57!llvm.module.flags = !{!0}58!dx.valver = !{!1}59!0 = !{i32 1, !"dx.resmayalias", i32 1}60!1 = !{i32 1, i32 8}61 62; DXC: - Name: SFI063; DXC-NEXT: Size: 864; DXC-NEXT: Flags:65; DXC: Max64UAVs: true66; DXC: NextUnusedBit: false67; DXC: ...68