Skip to content

Commit ac6421e

Browse files
committed
build ll test in spir-v config
1 parent 99b83a4 commit ac6421e

1 file changed

Lines changed: 53 additions & 39 deletions

File tree

Lines changed: 53 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: %dxopt %s -hlsl-passes-resume -dxilgen -S | FileCheck %s
2-
32
; generated the IR with ExtractIRForPassTest.py -p dxilgen -o LowerAllocateRayQuery2.ll tools\clang\test\CodeGenHLSL\allocateRayQuery2.hlsl -- -T lib_6_9
3+
; importantly, this is generated with spir-v gen enabled
44

55
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"
66
target triple = "dxil-ms-dx"
@@ -10,6 +10,7 @@ target triple = "dxil-ms-dx"
1010
%dx.types.ResourceProperties = type { i32, i32 }
1111
%struct.RayDesc = type { <3 x float>, float, <3 x float>, float }
1212
%"class.RayQuery<1024, 1>" = type { i32 }
13+
%"class.RayQuery<1, 0>" = type { i32 }
1314

1415
@"\01?RTAS@@3URaytracingAccelerationStructure@@A" = external global %struct.RaytracingAccelerationStructure, align 4
1516

@@ -32,12 +33,19 @@ declare i32 @"dx.hl.op..i32 (i32, i32, i32)"(i32, i32, i32) #0
3233
define void @main(<3 x float>, float, <3 x float>, float) #0 {
3334
entry:
3435
; CHECK: call i32 @dx.op.allocateRayQuery2(i32 258, i32 1024, i32 1), !dbg !8
35-
%rayQuery11 = call i32 @"dx.hl.op..i32 (i32, i32, i32)"(i32 4, i32 1024, i32 1), !dbg !38 ; line:8 col:79
36-
%4 = load %struct.RaytracingAccelerationStructure, %struct.RaytracingAccelerationStructure* @"\01?RTAS@@3URaytracingAccelerationStructure@@A", !dbg !42 ; line:10 col:3
37-
%5 = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.RaytracingAccelerationStructure)"(i32 0, %struct.RaytracingAccelerationStructure %4), !dbg !42 ; line:10 col:3
38-
%6 = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.RaytracingAccelerationStructure)"(i32 14, %dx.types.Handle %5, %dx.types.ResourceProperties { i32 16, i32 0 }, %struct.RaytracingAccelerationStructure zeroinitializer), !dbg !42 ; line:10 col:3
39-
call void @"dx.hl.op..void (i32, i32, %dx.types.Handle, i32, i32, <3 x float>, float, <3 x float>, float)"(i32 320, i32 %rayQuery11, %dx.types.Handle %6, i32 1024, i32 2, <3 x float> %0, float %1, <3 x float> %2, float %3), !dbg !42 ; line:10 col:3
40-
ret void, !dbg !43 ; line:11 col:1
36+
%rayQuery12 = call i32 @"dx.hl.op..i32 (i32, i32, i32)"(i32 4, i32 1024, i32 1), !dbg !42 ; line:8 col:79
37+
%4 = load %struct.RaytracingAccelerationStructure, %struct.RaytracingAccelerationStructure* @"\01?RTAS@@3URaytracingAccelerationStructure@@A", !dbg !46 ; line:10 col:3
38+
%5 = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.RaytracingAccelerationStructure)"(i32 0, %struct.RaytracingAccelerationStructure %4), !dbg !46 ; line:10 col:3
39+
%6 = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.RaytracingAccelerationStructure)"(i32 14, %dx.types.Handle %5, %dx.types.ResourceProperties { i32 16, i32 0 }, %struct.RaytracingAccelerationStructure zeroinitializer), !dbg !46 ; line:10 col:3
40+
call void @"dx.hl.op..void (i32, i32, %dx.types.Handle, i32, i32, <3 x float>, float, <3 x float>, float)"(i32 325, i32 %rayQuery12, %dx.types.Handle %6, i32 1024, i32 2, <3 x float> %0, float %1, <3 x float> %2, float %3), !dbg !46 ; line:10 col:3
41+
42+
; CHECK: call i32 @dx.op.allocateRayQuery(i32 178, i32 1), !dbg !10
43+
%rayQuery23 = call i32 @"dx.hl.op..i32 (i32, i32, i32)"(i32 4, i32 1, i32 0), !dbg !47 ; line:13 col:35
44+
%7 = load %struct.RaytracingAccelerationStructure, %struct.RaytracingAccelerationStructure* @"\01?RTAS@@3URaytracingAccelerationStructure@@A", !dbg !48 ; line:14 col:3
45+
%8 = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.RaytracingAccelerationStructure)"(i32 0, %struct.RaytracingAccelerationStructure %7), !dbg !48 ; line:14 col:3
46+
%9 = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.RaytracingAccelerationStructure)"(i32 14, %dx.types.Handle %8, %dx.types.ResourceProperties { i32 16, i32 0 }, %struct.RaytracingAccelerationStructure zeroinitializer), !dbg !48 ; line:14 col:3
47+
call void @"dx.hl.op..void (i32, i32, %dx.types.Handle, i32, i32, <3 x float>, float, <3 x float>, float)"(i32 325, i32 %rayQuery23, %dx.types.Handle %9, i32 0, i32 2, <3 x float> %0, float %1, <3 x float> %2, float %3), !dbg !48 ; line:14 col:3
48+
ret void, !dbg !49 ; line:15 col:1
4149
}
4250

4351
; Function Attrs: nounwind
@@ -52,17 +60,17 @@ attributes #1 = { nounwind readnone }
5260
!dx.version = !{!3}
5361
!dx.valver = !{!3}
5462
!dx.shaderModel = !{!4}
55-
!dx.typeAnnotations = !{!5, !17}
56-
!dx.entryPoints = !{!30}
57-
!dx.fnprops = !{!35}
58-
!dx.options = !{!36, !37}
63+
!dx.typeAnnotations = !{!5, !21}
64+
!dx.entryPoints = !{!34}
65+
!dx.fnprops = !{!39}
66+
!dx.options = !{!40, !41}
5967

6068
!0 = !{i32 2, !"Debug Info Version", i32 3}
6169
!1 = !{!"hlsl-hlemit", !"hlsl-hlensure"}
6270
!2 = !{!"dxc(private) 1.8.0.4853 (lowerOMM, ca5df957eb33-dirty)"}
6371
!3 = !{i32 1, i32 9}
6472
!4 = !{!"lib", i32 6, i32 9}
65-
!5 = !{i32 0, %struct.RayDesc undef, !6, %"class.RayQuery<1024, 1>" undef, !11}
73+
!5 = !{i32 0, %struct.RayDesc undef, !6, %"class.RayQuery<1024, 1>" undef, !11, %"class.RayQuery<1, 0>" undef, !17}
6674
!6 = !{i32 32, !7, !8, !9, !10}
6775
!7 = !{i32 6, !"Origin", i32 3, i32 0, i32 7, i32 9, i32 13, i32 3}
6876
!8 = !{i32 6, !"TMin", i32 3, i32 12, i32 7, i32 9}
@@ -74,30 +82,36 @@ attributes #1 = { nounwind readnone }
7482
!14 = !{!15, !16}
7583
!15 = !{i32 1, i64 1024}
7684
!16 = !{i32 1, i64 1}
77-
!17 = !{i32 1, void (<3 x float>, float, <3 x float>, float)* @main, !18}
78-
!18 = !{!19, !21, !24, !26, !28}
79-
!19 = !{i32 0, !20, !20}
80-
!20 = !{}
81-
!21 = !{i32 0, !22, !23}
82-
!22 = !{i32 4, !"RAYDESC", i32 7, i32 9}
83-
!23 = !{i32 0}
84-
!24 = !{i32 0, !22, !25}
85-
!25 = !{i32 1}
86-
!26 = !{i32 0, !22, !27}
87-
!27 = !{i32 2}
88-
!28 = !{i32 0, !22, !29}
89-
!29 = !{i32 3}
90-
!30 = !{null, !"", null, !31, null}
91-
!31 = !{!32, null, null, null}
92-
!32 = !{!33}
93-
!33 = !{i32 0, %struct.RaytracingAccelerationStructure* @"\01?RTAS@@3URaytracingAccelerationStructure@@A", !"RTAS", i32 -1, i32 -1, i32 1, i32 16, i32 0, !34}
94-
!34 = !{i32 0, i32 4}
95-
!35 = !{void (<3 x float>, float, <3 x float>, float)* @main, i32 1}
96-
!36 = !{i32 -2147483584}
97-
!37 = !{i32 -1}
98-
!38 = !DILocation(line: 8, column: 79, scope: !39)
99-
!39 = !DISubprogram(name: "main", scope: !40, file: !40, line: 5, type: !41, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, function: void (<3 x float>, float, <3 x float>, float)* @main)
100-
!40 = !DIFile(filename: "D:\5CDXC\5Ctools\5Cclang\5Ctest\5CCodeGenHLSL\5CallocateRayQuery2.hlsl", directory: "")
101-
!41 = !DISubroutineType(types: !20)
102-
!42 = !DILocation(line: 10, column: 3, scope: !39)
103-
!43 = !DILocation(line: 11, column: 1, scope: !39)
85+
!17 = !{i32 4, !12, !18}
86+
!18 = !{i32 0, !19}
87+
!19 = !{!16, !20}
88+
!20 = !{i32 1, i64 0}
89+
!21 = !{i32 1, void (<3 x float>, float, <3 x float>, float)* @main, !22}
90+
!22 = !{!23, !25, !28, !30, !32}
91+
!23 = !{i32 0, !24, !24}
92+
!24 = !{}
93+
!25 = !{i32 0, !26, !27}
94+
!26 = !{i32 4, !"RAYDESC", i32 7, i32 9}
95+
!27 = !{i32 0}
96+
!28 = !{i32 0, !26, !29}
97+
!29 = !{i32 1}
98+
!30 = !{i32 0, !26, !31}
99+
!31 = !{i32 2}
100+
!32 = !{i32 0, !26, !33}
101+
!33 = !{i32 3}
102+
!34 = !{null, !"", null, !35, null}
103+
!35 = !{!36, null, null, null}
104+
!36 = !{!37}
105+
!37 = !{i32 0, %struct.RaytracingAccelerationStructure* @"\01?RTAS@@3URaytracingAccelerationStructure@@A", !"RTAS", i32 -1, i32 -1, i32 1, i32 16, i32 0, !38}
106+
!38 = !{i32 0, i32 4}
107+
!39 = !{void (<3 x float>, float, <3 x float>, float)* @main, i32 1}
108+
!40 = !{i32 -2147483584}
109+
!41 = !{i32 -1}
110+
!42 = !DILocation(line: 8, column: 79, scope: !43)
111+
!43 = !DISubprogram(name: "main", scope: !44, file: !44, line: 5, type: !45, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, function: void (<3 x float>, float, <3 x float>, float)* @main)
112+
!44 = !DIFile(filename: "D:\5CDXC\5Ctools\5Cclang\5Ctest\5CCodeGenHLSL\5CallocateRayQuery2.hlsl", directory: "")
113+
!45 = !DISubroutineType(types: !24)
114+
!46 = !DILocation(line: 10, column: 3, scope: !43)
115+
!47 = !DILocation(line: 13, column: 35, scope: !43)
116+
!48 = !DILocation(line: 14, column: 3, scope: !43)
117+
!49 = !DILocation(line: 15, column: 1, scope: !43)

0 commit comments

Comments
 (0)