46 lines · plain
1; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s2 3; This test checks to ensure that setting the LLVM module flag "dx.resmayalias"4; to 0 has no effect on the DXIL shader flag analysis for the flag5; ResMayNotAlias.6 7target triple = "dxil-pc-shadermodel6.8-library"8 9; CHECK: Combined Shader Flags for Module10; CHECK-NEXT: Shader Flags Value: 0x20000001011 12; CHECK: Note: extra DXIL module flags:13; CHECK: Raw and structured buffers14; CHECK: Any UAV may not alias any other UAV15;16 17; CHECK: Function loadUAV : 0x2000000018define float @loadUAV() #0 {19 %res = call target("dx.TypedBuffer", float, 1, 0, 0)20 @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 1, i32 0, ptr null)21 %load = call {float, i1} @llvm.dx.resource.load.typedbuffer(22 target("dx.TypedBuffer", float, 1, 0, 0) %res, i32 0)23 %val = extractvalue {float, i1} %load, 024 ret float %val25}26 27; CHECK: Function loadSRV : 0x0000001028define float @loadSRV() #0 {29 %res = tail call target("dx.RawBuffer", float, 0, 0)30 @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 1, i32 0, ptr null)31 %load = call {float, i1} @llvm.dx.resource.load.rawbuffer(32 target("dx.RawBuffer", float, 0, 0) %res, i32 0, i32 0)33 %val = extractvalue { float, i1 } %load, 034 ret float %val35}36 37!llvm.module.flags = !{!0}38!dx.valver = !{!1}39 40; dx.resmayalias should never appear with a value of 0.41; But if it does, ensure that it has no effect.42!0 = !{i32 1, !"dx.resmayalias", i32 0}43!1 = !{i32 1, i32 8}44 45attributes #0 = { convergent norecurse nounwind "hlsl.export"}46