42 lines · plain
1; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s2 3; This test checks to ensure the behavior of the DXIL shader flag analysis for4; the flag ResMayNotAlias is correct when the DXIL validator version is >= 1.8.5; The ResMayNotAlias flag (0x20000000) should only be set when a function uses a6; UAV.7 8target triple = "dxil-pc-shadermodel6.7-library"9 10; CHECK: Combined Shader Flags for Module11; CHECK-NEXT: Shader Flags Value: 0x20000001012 13; CHECK: Note: extra DXIL module flags:14; CHECK: Raw and structured buffers15; CHECK: Any UAV may not alias any other UAV16;17 18; CHECK: Function loadUAV : 0x2000000019define float @loadUAV() #0 {20 %res = call target("dx.TypedBuffer", float, 1, 0, 0)21 @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 1, i32 0, ptr null)22 %load = call {float, i1} @llvm.dx.resource.load.typedbuffer(23 target("dx.TypedBuffer", float, 1, 0, 0) %res, i32 0)24 %val = extractvalue {float, i1} %load, 025 ret float %val26}27 28; CHECK: Function loadSRV : 0x0000001029define float @loadSRV() #0 {30 %res = tail call target("dx.RawBuffer", float, 0, 0)31 @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 1, i32 0, ptr null)32 %load = call {float, i1} @llvm.dx.resource.load.rawbuffer(33 target("dx.RawBuffer", float, 0, 0) %res, i32 0, i32 0)34 %val = extractvalue { float, i1 } %load, 035 ret float %val36}37 38!dx.valver = !{!0}39!0 = !{i32 1, i32 8}40 41attributes #0 = { convergent norecurse nounwind "hlsl.export"}42