1+ ; RUN: %dxopt %s -hlsl-passes-resume -scalarrepl-param-hlsl -S | FileCheck %s
2+ ; REQUIRES: dxil-1-9
3+
4+ ;
5+ ; Buffer Definitions:
6+ ;
7+ ; cbuffer $Globals
8+ ; {
9+ ;
10+ ; [0 x i8] (type annotation not present)
11+ ;
12+ ; }
13+ ;
14+ ;
15+ ; Resource Bindings:
16+ ;
17+ ; Name Type Format Dim ID HLSL Bind Count
18+ ; ------------------------------ ---------- ------- ----------- ------- -------------- ------
19+ ; $Globals cbuffer NA NA CB0 cb4294967295 1
20+ ;
21+ 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"
22+ target triple = "dxil-ms-dx"
23+
24+ %ConstantBuffer = type opaque
25+ %dx.types.HitObject = type { i8* }
26+ %"class.dx::HitObject" = type { i32 }
27+ %struct.RayDesc = type { <3 x float >, float , <3 x float >, float }
28+
29+ @"$Globals" = external constant %ConstantBuffer
30+
31+ ; Function Attrs: nounwind
32+ define void @"\01 ?main@@YAXXZ" () #0 {
33+ entry:
34+ %hit = alloca %dx.types.HitObject , align 4
35+ %tmp = alloca %dx.types.HitObject , align 4
36+ %ray = alloca %struct.RayDesc , align 4
37+ %tmp2 = alloca %dx.types.HitObject , align 4
38+ %0 = bitcast %dx.types.HitObject* %hit to i8* , !dbg !23 ; line:42 col:3
39+ call void @llvm.lifetime.start (i64 4 , i8* %0 ) #0 , !dbg !23 ; line:42 col:3
40+ ; CHECK: %{{[^ ]+}} = call %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %{{[^ ]+}})
41+ %1 = call %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)" (i32 358 , %dx.types.HitObject* %hit ), !dbg !27 ; line:42 col:17
42+ %2 = bitcast %dx.types.HitObject* %tmp to i8* , !dbg !28 ; line:43 col:3
43+ call void @llvm.lifetime.start (i64 4 , i8* %2 ) #0 , !dbg !28 ; line:43 col:3
44+ ; CHECK: call void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %{{[^ ]+}})
45+ call void @"dx.hl.op..void (i32, %dx.types.HitObject*)" (i32 358 , %dx.types.HitObject* %tmp ), !dbg !28 ; line:43 col:3
46+ %3 = bitcast %dx.types.HitObject* %tmp to i8* , !dbg !28 ; line:43 col:3
47+ call void @llvm.lifetime.end (i64 4 , i8* %3 ) #0 , !dbg !28 ; line:43 col:3
48+ %4 = bitcast %struct.RayDesc* %ray to i8* , !dbg !29 ; line:44 col:3
49+ call void @llvm.lifetime.start (i64 32 , i8* %4 ) #0 , !dbg !29 ; line:44 col:3
50+ %5 = getelementptr inbounds %struct.RayDesc , %struct.RayDesc* %ray , i32 0 , i32 0 , !dbg !30 ; line:44 col:17
51+ store <3 x float > zeroinitializer , <3 x float >* %5 , !dbg !30 ; line:44 col:17
52+ %6 = getelementptr inbounds %struct.RayDesc , %struct.RayDesc* %ray , i32 0 , i32 1 , !dbg !30 ; line:44 col:17
53+ store float 0 .000000e+00 , float * %6 , !dbg !30 ; line:44 col:17
54+ %7 = getelementptr inbounds %struct.RayDesc , %struct.RayDesc* %ray , i32 0 , i32 2 , !dbg !30 ; line:44 col:17
55+ store <3 x float > <float 0 .000000e+00 , float 1 .000000e+00 , float 0x3FA99999A0000000 >, <3 x float >* %7 , !dbg !30 ; line:44 col:17
56+ %8 = getelementptr inbounds %struct.RayDesc , %struct.RayDesc* %ray , i32 0 , i32 3 , !dbg !30 ; line:44 col:17
57+ store float 1 .000000e+03 , float * %8 , !dbg !30 ; line:44 col:17
58+ %9 = bitcast %dx.types.HitObject* %tmp2 to i8* , !dbg !31 ; line:45 col:3
59+ call void @llvm.lifetime.start (i64 4 , i8* %9 ) #0 , !dbg !31 ; line:45 col:3
60+ ; CHECK: call void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, <3 x float>, float, <3 x float>, float)"(i32 360, %dx.types.HitObject* %{{[^ ]+}}, i32 0, i32 1, <3 x float> %{{[^ ]+}}, float %{{[^ ]+}}, <3 x float> %{{[^ ]+}}, float %{{[^ ]+}})
61+ call void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, %struct.RayDesc*)" (i32 360 , %dx.types.HitObject* %tmp2 , i32 0 , i32 1 , %struct.RayDesc* %ray ), !dbg !31 ; line:45 col:3
62+ %10 = bitcast %dx.types.HitObject* %tmp2 to i8* , !dbg !31 ; line:45 col:3
63+ call void @llvm.lifetime.end (i64 4 , i8* %10 ) #0 , !dbg !31 ; line:45 col:3
64+ %11 = bitcast %struct.RayDesc* %ray to i8* , !dbg !32 ; line:46 col:1
65+ call void @llvm.lifetime.end (i64 32 , i8* %11 ) #0 , !dbg !32 ; line:46 col:1
66+ %12 = bitcast %dx.types.HitObject* %hit to i8* , !dbg !32 ; line:46 col:1
67+ call void @llvm.lifetime.end (i64 4 , i8* %12 ) #0 , !dbg !32 ; line:46 col:1
68+ ret void , !dbg !32 ; line:46 col:1
69+ }
70+
71+ ; Function Attrs: nounwind
72+ declare void @llvm.lifetime.start (i64 , i8* nocapture ) #0
73+
74+ ; Function Attrs: nounwind
75+ declare void @llvm.lifetime.end (i64 , i8* nocapture ) #0
76+
77+ ; Function Attrs: nounwind
78+ declare %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)" (i32 , %dx.types.HitObject* ) #0
79+
80+ ; Function Attrs: nounwind
81+ declare void @"dx.hl.op..void (i32, %dx.types.HitObject*)" (i32 , %dx.types.HitObject* ) #0
82+
83+ ; Function Attrs: nounwind
84+ declare void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, %struct.RayDesc*)" (i32 , %dx.types.HitObject* , i32 , i32 , %struct.RayDesc* ) #0
85+
86+ attributes #0 = { nounwind }
87+
88+ !llvm.module.flags = !{!0 }
89+ !pauseresume = !{!1 }
90+ !dx.version = !{!2 }
91+ !dx.valver = !{!2 }
92+ !dx.shaderModel = !{!3 }
93+ !dx.typeAnnotations = !{!4 , !12 }
94+ !dx.entryPoints = !{!16 }
95+ !dx.fnprops = !{!20 }
96+ !dx.options = !{!21 , !22 }
97+
98+ !0 = !{i32 2 , !"Debug Info Version" , i32 3 }
99+ !1 = !{!"hlsl-hlemit" , !"hlsl-hlensure" }
100+ !2 = !{i32 1 , i32 9 }
101+ !3 = !{!"lib" , i32 6 , i32 9 }
102+ !4 = !{i32 0 , %"class.dx::HitObject" undef , !5 , %struct.RayDesc undef , !7 }
103+ !5 = !{i32 4 , !6 }
104+ !6 = !{i32 6 , !"h" , i32 3 , i32 0 , i32 7 , i32 4 }
105+ !7 = !{i32 32 , !8 , !9 , !10 , !11 }
106+ !8 = !{i32 6 , !"Origin" , i32 3 , i32 0 , i32 7 , i32 9 , i32 13 , i32 3 }
107+ !9 = !{i32 6 , !"TMin" , i32 3 , i32 12 , i32 7 , i32 9 }
108+ !10 = !{i32 6 , !"Direction" , i32 3 , i32 16 , i32 7 , i32 9 , i32 13 , i32 3 }
109+ !11 = !{i32 6 , !"TMax" , i32 3 , i32 28 , i32 7 , i32 9 }
110+ !12 = !{i32 1 , void ()* @"\01 ?main@@YAXXZ" , !13 }
111+ !13 = !{!14 }
112+ !14 = !{i32 1 , !15 , !15 }
113+ !15 = !{}
114+ !16 = !{null , !"" , null , !17 , null }
115+ !17 = !{null , null , !18 , null }
116+ !18 = !{!19 }
117+ !19 = !{i32 0 , %ConstantBuffer* @"$Globals" , !"$Globals" , i32 0 , i32 -1 , i32 1 , i32 0 , null }
118+ !20 = !{void ()* @"\01 ?main@@YAXXZ" , i32 7 }
119+ !21 = !{i32 -2147483584 }
120+ !22 = !{i32 -1 }
121+ !23 = !DILocation (line: 42 , column: 3 , scope: !24 )
122+ !24 = !DISubprogram (name: "main" , scope: !25 , file: !25 , line: 41 , type: !26 , isLocal: false , isDefinition: true , scopeLine: 41 , flags: DIFlagPrototyped, isOptimized: false , function: void ()* @"\01 ?main@@YAXXZ" )
123+ !25 = !DIFile (filename: "tools/clang/test/HLSLFileCheck/hlsl/objects/HitObject/hitobject_make_ast.hlsl" , directory: "" )
124+ !26 = !DISubroutineType (types: !15 )
125+ !27 = !DILocation (line: 42 , column: 17 , scope: !24 )
126+ !28 = !DILocation (line: 43 , column: 3 , scope: !24 )
127+ !29 = !DILocation (line: 44 , column: 3 , scope: !24 )
128+ !30 = !DILocation (line: 44 , column: 17 , scope: !24 )
129+ !31 = !DILocation (line: 45 , column: 3 , scope: !24 )
130+ !32 = !DILocation (line: 46 , column: 1 , scope: !24 )
0 commit comments