|
| 1 | +; RUN: %dxopt %s -hlsl-passes-resume -dxilgen -S | FileCheck %s |
| 2 | + |
| 3 | +; CHECK: call i32 @dx.op.getGroupWaveIndex(i32 -2147483647) |
| 4 | +; CHECK: call i32 @dx.op.getGroupWaveCount(i32 -2147483646) |
| 5 | + |
| 6 | +; Generated from: |
| 7 | +; utils/hct/ExtractIRForPassTest.py -p dxilgen -o tools/clang/test/DXC/Passes/DxilGen/group-wave-index.ll tools/clang/test/HLSLFileCheckLit/hlsl/intrinsics/wave/group-wave-index.hlsl -- -T cs_6_10 -E main |
| 8 | +; Debug info manually stripped. |
| 9 | + |
| 10 | +target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" |
| 11 | +target triple = "dxil-ms-dx" |
| 12 | + |
| 13 | +%"class.RWStructuredBuffer<unsigned int>" = type { i32 } |
| 14 | +%dx.types.Handle = type { i8* } |
| 15 | +%dx.types.ResourceProperties = type { i32, i32 } |
| 16 | + |
| 17 | +@"\01?output0@@3V?$RWStructuredBuffer@I@@A" = external global %"class.RWStructuredBuffer<unsigned int>", align 4 |
| 18 | + |
| 19 | +; Function Attrs: nounwind |
| 20 | +define void @main(<3 x i32> %id) #0 { |
| 21 | +entry: |
| 22 | + %0 = call i32 @"dx.hl.op.rn.i32 (i32)"(i32 396) |
| 23 | + %1 = call i32 @"dx.hl.op.rn.i32 (i32)"(i32 395) |
| 24 | + %2 = load %"class.RWStructuredBuffer<unsigned int>", %"class.RWStructuredBuffer<unsigned int>"* @"\01?output0@@3V?$RWStructuredBuffer@I@@A" |
| 25 | + %3 = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %\22class.RWStructuredBuffer<unsigned int>\22)"(i32 0, %"class.RWStructuredBuffer<unsigned int>" %2) |
| 26 | + %4 = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %\22class.RWStructuredBuffer<unsigned int>\22)"(i32 14, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 4108, i32 4 }, %"class.RWStructuredBuffer<unsigned int>" zeroinitializer) |
| 27 | + %5 = call i32* @"dx.hl.subscript.[].rn.i32* (i32, %dx.types.Handle, i32)"(i32 0, %dx.types.Handle %4, i32 0) |
| 28 | + store i32 %0, i32* %5 |
| 29 | + %6 = load %"class.RWStructuredBuffer<unsigned int>", %"class.RWStructuredBuffer<unsigned int>"* @"\01?output0@@3V?$RWStructuredBuffer@I@@A" |
| 30 | + %7 = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %\22class.RWStructuredBuffer<unsigned int>\22)"(i32 0, %"class.RWStructuredBuffer<unsigned int>" %6) |
| 31 | + %8 = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %\22class.RWStructuredBuffer<unsigned int>\22)"(i32 14, %dx.types.Handle %7, %dx.types.ResourceProperties { i32 4108, i32 4 }, %"class.RWStructuredBuffer<unsigned int>" zeroinitializer) |
| 32 | + %9 = call i32* @"dx.hl.subscript.[].rn.i32* (i32, %dx.types.Handle, i32)"(i32 0, %dx.types.Handle %8, i32 16) |
| 33 | + store i32 %1, i32* %9 |
| 34 | + ret void |
| 35 | +} |
| 36 | + |
| 37 | +; Function Attrs: nounwind |
| 38 | +declare void @llvm.lifetime.start(i64, i8* nocapture) #0 |
| 39 | + |
| 40 | +; Function Attrs: nounwind |
| 41 | +declare void @llvm.lifetime.end(i64, i8* nocapture) #0 |
| 42 | + |
| 43 | +; Function Attrs: nounwind readnone |
| 44 | +declare i32 @"dx.hl.op.rn.i32 (i32)"(i32) #1 |
| 45 | + |
| 46 | +; Function Attrs: nounwind readnone |
| 47 | +declare i32* @"dx.hl.subscript.[].rn.i32* (i32, %dx.types.Handle, i32)"(i32, %dx.types.Handle, i32) #1 |
| 48 | + |
| 49 | +; Function Attrs: nounwind readnone |
| 50 | +declare %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %\22class.RWStructuredBuffer<unsigned int>\22)"(i32, %"class.RWStructuredBuffer<unsigned int>") #1 |
| 51 | + |
| 52 | +; Function Attrs: nounwind readnone |
| 53 | +declare %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %\22class.RWStructuredBuffer<unsigned int>\22)"(i32, %dx.types.Handle, %dx.types.ResourceProperties, %"class.RWStructuredBuffer<unsigned int>") #1 |
| 54 | + |
| 55 | +attributes #0 = { nounwind } |
| 56 | +attributes #1 = { nounwind readnone } |
| 57 | + |
| 58 | +!pauseresume = !{!1} |
| 59 | +!llvm.ident = !{!2} |
| 60 | +!dx.version = !{!3} |
| 61 | +!dx.valver = !{!3} |
| 62 | +!dx.shaderModel = !{!4} |
| 63 | +!dx.typeAnnotations = !{!5, !11} |
| 64 | +!dx.entryPoints = !{!18} |
| 65 | +!dx.fnprops = !{!23} |
| 66 | +!dx.options = !{!24, !25} |
| 67 | + |
| 68 | +!1 = !{!"hlsl-hlemit", !"hlsl-hlensure"} |
| 69 | +!2 = !{!"dxc(private) 1.8.0.5134 (Group-Wave-Intrinsics, 84e7262d3)"} |
| 70 | +!3 = !{i32 1, i32 10} |
| 71 | +!4 = !{!"cs", i32 6, i32 10} |
| 72 | +!5 = !{i32 0, %"class.RWStructuredBuffer<unsigned int>" undef, !6} |
| 73 | +!6 = !{i32 4, !7, !8} |
| 74 | +!7 = !{i32 6, !"h", i32 3, i32 0, i32 7, i32 5} |
| 75 | +!8 = !{i32 0, !9} |
| 76 | +!9 = !{!10} |
| 77 | +!10 = !{i32 0, i32 undef} |
| 78 | +!11 = !{i32 1, void (<3 x i32>)* @main, !12} |
| 79 | +!12 = !{!13, !15} |
| 80 | +!13 = !{i32 1, !14, !14} |
| 81 | +!14 = !{} |
| 82 | +!15 = !{i32 0, !16, !17} |
| 83 | +!16 = !{i32 4, !"SV_DispatchThreadID", i32 7, i32 5, i32 13, i32 3} |
| 84 | +!17 = !{i32 0} |
| 85 | +!18 = !{void (<3 x i32>)* @main, !"main", null, !19, null} |
| 86 | +!19 = !{null, !20, null, null} |
| 87 | +!20 = !{!21} |
| 88 | +!21 = !{i32 0, %"class.RWStructuredBuffer<unsigned int>"* @"\01?output0@@3V?$RWStructuredBuffer@I@@A", !"output0", i32 0, i32 0, i32 1, i32 12, i1 false, i1 false, i1 false, !22} |
| 89 | +!22 = !{i32 1, i32 4} |
| 90 | +!23 = !{void (<3 x i32>)* @main, i32 5, i32 1, i32 1, i32 1} |
| 91 | +!24 = !{i32 64} |
| 92 | +!25 = !{i32 -1} |
0 commit comments