1
1
; RUN: opt -S -dxil-forward-handle-accesses -mtriple=dxil--shadermodel6.3-library %s | FileCheck %s
2
2
3
3
%__cblayout_CB = type <{ float , i32 , i32 }>
4
+ %__cblayout_CB2 = type <{ float }>
4
5
%struct.Scalars = type { float , i32 , i32 }
5
6
6
7
@CB.cb = local_unnamed_addr global target ("dx.CBuffer" , target ("dx.Layout" , %__cblayout_CB , 12 , 0 , 4 , 8 )) poison
8
+ @CB2.cb = local_unnamed_addr global target ("dx.CBuffer" , target ("dx.Layout" , %__cblayout_CB2 , 4 , 0 )) poison
7
9
8
10
define void @main () local_unnamed_addr #1 {
9
11
entry:
@@ -17,6 +19,13 @@ entry:
17
19
%0 = call { float , float , float , float } @llvm.dx.resource.load.cbufferrow.4 (target ("dx.CBuffer" , target ("dx.Layout" , %__cblayout_CB , 12 , 0 , 4 , 8 )) %cb , i32 0 )
18
20
%1 = extractvalue { float , float , float , float } %0 , 0
19
21
call void @llvm.dx.resource.store.rawbuffer (target ("dx.RawBuffer" , %struct.Scalars , 1 , 0 ) %_ZL3Out_h.i.i , i32 0 , i32 0 , float %1 )
22
+
23
+ ; CHECK: [[CB2:%.*]] = tail call target({{.*}}) @llvm.dx.resource.handlefromimplicitbinding
24
+ %h2 = tail call target ("dx.CBuffer" , target ("dx.Layout" , %__cblayout_CB2 , 4 , 0 )) @llvm.dx.resource.handlefromimplicitbinding (i32 100 , i32 0 , i32 1 , i32 0 , i1 false , ptr null )
25
+ store target ("dx.CBuffer" , target ("dx.Layout" , %__cblayout_CB2 , 4 , 0 )) %h2 , ptr @CB2.cb , align 4
26
+ ; CHECK-NOT: load target({{.*}}), ptr @CB2.cb
27
+ %cb2 = load target ("dx.CBuffer" , target ("dx.Layout" , %__cblayout_CB2 , 4 , 0 )), ptr @CB2.cb , align 4
28
+
20
29
ret void
21
30
}
22
31
0 commit comments