Skip to content

Commit 712ef00

Browse files
committed
Update test to accomodate lack of gep duplication within same basic block
1 parent a1ca690 commit 712ef00

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ entry:
2121
%a1 = load float, ptr addrspace(2) getelementptr inbounds nuw (i8, ptr addrspace(2) @a1, i32 16), align 4
2222
store float %a1, ptr %dst, align 32
2323

24+
%a2 = load float, ptr addrspace(2) getelementptr inbounds nuw (i8, ptr addrspace(2) @a1, i32 16), align 4
25+
store float %a2, ptr %dst, align 32
26+
27+
ret void
28+
}
29+
30+
define void @g(ptr %dst) {
31+
entry:
32+
; CHECK: [[PTR:%.*]] = call ptr addrspace(2) @llvm.dx.resource.getpointer.{{.*}}(target("dx.CBuffer", %__cblayout_CB) {{%.*}}, i32 0)
33+
; CHECK: getelementptr inbounds nuw i8, ptr addrspace(2) [[PTR]], i32 16
34+
%a1 = load float, ptr addrspace(2) getelementptr inbounds nuw (i8, ptr addrspace(2) @a1, i32 16), align 4
35+
store float %a1, ptr %dst, align 32
36+
br label %next
37+
38+
next:
2439
; CHECK: [[PTR:%.*]] = call ptr addrspace(2) @llvm.dx.resource.getpointer.{{.*}}(target("dx.CBuffer", %__cblayout_CB) {{%.*}}, i32 0)
2540
; CHECK: getelementptr inbounds nuw i8, ptr addrspace(2) [[PTR]], i32 16
2641
%a2 = load float, ptr addrspace(2) getelementptr inbounds nuw (i8, ptr addrspace(2) @a1, i32 16), align 4

0 commit comments

Comments
 (0)