1 ; RUN: opt -print-memderefs -analyze -S <%s | FileCheck %s
3 ; Uses the print-deref (+ analyze to print) pass to run
4 ; isDereferenceablePointer() on many load instruction operands
6 declare zeroext i1 @return_i1()
8 @globalstr = global [6 x i8] c"hello\00"
10 define void @test(i32 addrspace(1)* byval %dparam) {
11 ; CHECK: The following are dereferenceable:
15 ; We haven't yet taught it to look through relocations
16 ; CHECK-NOT: %relocate
19 %globalptr = getelementptr inbounds [6 x i8]* @globalstr, i32 0, i32 0
20 %load1 = load i8* %globalptr
22 %load2 = load i1* %alloca
23 %load3 = load i32 addrspace(1)* %dparam
24 %tok = tail call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 addrspace(1)* %dparam)
25 %relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %tok, i32 4, i32 4)
26 %load4 = load i32 addrspace(1)* %relocate
27 %nparam = getelementptr i32 addrspace(1)* %dparam, i32 5
28 %load5 = load i32 addrspace(1)* %nparam
32 declare i32 @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()*, i32, i32, ...)
33 declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32, i32, i32)