Skip to content

Commit 06c8ee6

Browse files
authored
[NFC] [DirectX] Make DirectX codegen test CBufferAccess/gep-ce-two-uses.ll more strict (llvm#169855)
Continuation of PR llvm#169848 to address PR comments. This PR makes the test more strict by adding CHECKs to ensure the loads are indeed using the same or different GEPs.
1 parent 8459508 commit 06c8ee6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

llvm/test/CodeGen/DirectX/CBufferAccess/gep-ce-two-uses.ll

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
define void @f(ptr %dst) {
1818
entry:
1919
; CHECK: [[PTR:%.*]] = call ptr addrspace(2) @llvm.dx.resource.getpointer.{{.*}}(target("dx.CBuffer", %__cblayout_CB) {{%.*}}, i32 0)
20-
; CHECK: getelementptr inbounds nuw i8, ptr addrspace(2) [[PTR]], i32 16
20+
; CHECK: [[GEP:%.*]] = getelementptr inbounds nuw i8, ptr addrspace(2) [[PTR]], i32 16
21+
; CHECK-COUNT-2: load float, ptr addrspace(2) [[GEP]]
2122
%a1 = load float, ptr addrspace(2) getelementptr inbounds nuw (i8, ptr addrspace(2) @a1, i32 16), align 4
2223
store float %a1, ptr %dst, align 32
2324

@@ -30,15 +31,17 @@ entry:
3031
; CHECK: define void @g
3132
define void @g(ptr %dst) {
3233
entry:
33-
; CHECK: [[PTR:%.*]] = call ptr addrspace(2) @llvm.dx.resource.getpointer.{{.*}}(target("dx.CBuffer", %__cblayout_CB) {{%.*}}, i32 0)
34-
; CHECK: getelementptr inbounds nuw i8, ptr addrspace(2) [[PTR]], i32 16
34+
; CHECK: [[PTR1:%.*]] = call ptr addrspace(2) @llvm.dx.resource.getpointer.{{.*}}(target("dx.CBuffer", %__cblayout_CB) {{%.*}}, i32 0)
35+
; CHECK: [[GEP1:%.*]] = getelementptr inbounds nuw i8, ptr addrspace(2) [[PTR1]], i32 16
36+
; CHECK: load float, ptr addrspace(2) [[GEP1]]
3537
%a1 = load float, ptr addrspace(2) getelementptr inbounds nuw (i8, ptr addrspace(2) @a1, i32 16), align 4
3638
store float %a1, ptr %dst, align 32
3739
br label %next
3840

3941
next:
40-
; CHECK: [[PTR:%.*]] = call ptr addrspace(2) @llvm.dx.resource.getpointer.{{.*}}(target("dx.CBuffer", %__cblayout_CB) {{%.*}}, i32 0)
41-
; CHECK: getelementptr inbounds nuw i8, ptr addrspace(2) [[PTR]], i32 16
42+
; CHECK: [[PTR2:%.*]] = call ptr addrspace(2) @llvm.dx.resource.getpointer.{{.*}}(target("dx.CBuffer", %__cblayout_CB) {{%.*}}, i32 0)
43+
; CHECK: [[GEP2:%.*]] = getelementptr inbounds nuw i8, ptr addrspace(2) [[PTR2]], i32 16
44+
; CHECK: load float, ptr addrspace(2) [[GEP2]]
4245
%a2 = load float, ptr addrspace(2) getelementptr inbounds nuw (i8, ptr addrspace(2) @a1, i32 16), align 4
4346
store float %a2, ptr %dst, align 32
4447

0 commit comments

Comments
 (0)