brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · ba03d39 Raw
41 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 analysis4; for the flag ResMayNotAlias is correct when the DXIL Version is < 1.7. The5; ResMayNotAlias flag (0x20000000) should not be set at all.6 7target triple = "dxil-pc-shadermodel6.6-library"8 9; CHECK:      Combined Shader Flags for Module10; CHECK-NEXT: Shader Flags Value: 0x0000001011 12; CHECK: Note: extra DXIL module flags:13; CHECK:       Raw and structured buffers14; CHECK-NOT:   Any UAV may not alias any other UAV15;16 17; CHECK: Function loadUAV : 0x0000000018define 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!dx.valver = !{!0}38!0 = !{i32 1, i32 8}39 40attributes #0 = { convergent norecurse nounwind "hlsl.export"}41