diff options
author | Stephen Hines <srhines@google.com> | 2015-03-23 12:10:34 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2015-03-23 12:10:34 -0700 |
commit | ebe69fe11e48d322045d5949c83283927a0d790b (patch) | |
tree | c92f1907a6b8006628a4b01615f38264d29834ea /test/Analysis/ValueTracking/memory-dereferenceable.ll | |
parent | b7d2e72b02a4cb8034f32f8247a2558d2434e121 (diff) | |
download | external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.zip external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.gz external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.bz2 |
Update aosp/master LLVM for rebase to r230699.
Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
Diffstat (limited to 'test/Analysis/ValueTracking/memory-dereferenceable.ll')
-rw-r--r-- | test/Analysis/ValueTracking/memory-dereferenceable.ll | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Analysis/ValueTracking/memory-dereferenceable.ll b/test/Analysis/ValueTracking/memory-dereferenceable.ll new file mode 100644 index 0000000..1c55efc --- /dev/null +++ b/test/Analysis/ValueTracking/memory-dereferenceable.ll @@ -0,0 +1,34 @@ +; RUN: opt -print-memderefs -analyze -S <%s | FileCheck %s + +; Uses the print-deref (+ analyze to print) pass to run +; isDereferenceablePointer() on many load instruction operands + +target datalayout = "e" + +declare zeroext i1 @return_i1() + +@globalstr = global [6 x i8] c"hello\00" + +define void @test(i32 addrspace(1)* dereferenceable(8) %dparam) { +; CHECK: The following are dereferenceable: +; CHECK: %globalptr +; CHECK: %alloca +; CHECK: %dparam +; CHECK: %relocate +; CHECK-NOT: %nparam +entry: + %globalptr = getelementptr inbounds [6 x i8]* @globalstr, i32 0, i32 0 + %load1 = load i8* %globalptr + %alloca = alloca i1 + %load2 = load i1* %alloca + %load3 = load i32 addrspace(1)* %dparam + %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) + %relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %tok, i32 4, i32 4) + %load4 = load i32 addrspace(1)* %relocate + %nparam = getelementptr i32 addrspace(1)* %dparam, i32 5 + %load5 = load i32 addrspace(1)* %nparam + ret void +} + +declare i32 @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()*, i32, i32, ...) +declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32, i32, i32) |