summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Analysis/GlobalsModRef/argmemonly-escape.ll47
-rw-r--r--llvm/test/Analysis/GlobalsModRef/inaccessiblememonly.ll21
-rw-r--r--llvm/test/Analysis/GlobalsModRef/modreftest.ll20
3 files changed, 21 insertions, 67 deletions
diff --git a/llvm/test/Analysis/GlobalsModRef/argmemonly-escape.ll b/llvm/test/Analysis/GlobalsModRef/argmemonly-escape.ll
deleted file mode 100644
index 64c625810af..00000000000
--- a/llvm/test/Analysis/GlobalsModRef/argmemonly-escape.ll
+++ /dev/null
@@ -1,47 +0,0 @@
-; RUN: opt < %s -O1 -S -enable-non-lto-gmr=true | FileCheck %s
-
-target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-apple-macosx10.10.0"
-
-@a = internal global [3 x i32] zeroinitializer, align 4
-
-; The important thing we're checking for here is the reload of (some element of)
-; @a after the memset.
-
-; CHECK-LABEL: @main
-; CHECK: load i32, i32* getelementptr {{.*}} @a
-; CHECK-NEXT: call void @memsetp0i8i64{{.*}} @a
-; CHECK-NEXT: load i32, i32* getelementptr {{.*}} @a
-; CHECK-NEXT: call void @memsetp0i8i64A{{.*}} @a
-; CHECK-NEXT: load i32, i32* getelementptr {{.*}} @a
-; CHECK: icmp eq
-; CHECK: br i1
-
-define i32 @main() {
-entry:
- %0 = bitcast [3 x i32]* @a to i8*
- %1 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @a, i64 0, i64 2), align 4
- call void @memsetp0i8i64(i8* %0, i8 0, i64 4, i32 4, i1 false)
- %2 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @a, i64 0, i64 2), align 4
- call void @memsetp0i8i64A(i8* %0, i8 0, i64 4, i32 4, i1 false)
- %3 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @a, i64 0, i64 2), align 4
- %4 = add i32 %2, %3
- %cmp1 = icmp eq i32 %1, %4
- br i1 %cmp1, label %if.then, label %if.end
-
-if.then: ; preds = %entr
- call void @abort() #3
- unreachable
-
-if.end: ; preds = %entry
- ret i32 0
-}
-
-; Function Attrs: nounwind argmemonly
-declare void @memsetp0i8i64(i8* nocapture, i8, i64, i32, i1) nounwind argmemonly
-
-; Function Attrs: nounwind inaccessiblemem_or_argmemonly
-declare void @memsetp0i8i64A(i8* nocapture, i8, i64, i32, i1) nounwind inaccessiblemem_or_argmemonly
-
-; Function Attrs: noreturn nounwind
-declare void @abort() noreturn nounwind
diff --git a/llvm/test/Analysis/GlobalsModRef/inaccessiblememonly.ll b/llvm/test/Analysis/GlobalsModRef/inaccessiblememonly.ll
new file mode 100644
index 00000000000..d7a3cfc78a3
--- /dev/null
+++ b/llvm/test/Analysis/GlobalsModRef/inaccessiblememonly.ll
@@ -0,0 +1,21 @@
+; RUN: opt -O3 -S < %s | FileCheck %s
+
+target datalayout = "e-i64:64-f80:128-n8:16:32:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @donteliminate() {
+; CHECK-LABEL: donteliminate
+; CHECK-NEXT: tail call noalias i8* @allocmemory()
+; CHECK-NEXT: tail call noalias i8* @allocmemory()
+; CHECK-NEXT: tail call noalias i8* @allocmemory()
+; CHECK-NEXT: ret void
+ %1 = tail call noalias i8* @allocmemory()
+ %2 = tail call noalias i8* @allocmemory()
+ %3 = tail call noalias i8* @allocmemory()
+ ret void
+}
+
+; Function Attrs: inaccessiblememonly
+declare noalias i8* @allocmemory() #0
+
+attributes #0 = { inaccessiblememonly }
diff --git a/llvm/test/Analysis/GlobalsModRef/modreftest.ll b/llvm/test/Analysis/GlobalsModRef/modreftest.ll
index 2018b149fc0..07497705e65 100644
--- a/llvm/test/Analysis/GlobalsModRef/modreftest.ll
+++ b/llvm/test/Analysis/GlobalsModRef/modreftest.ll
@@ -16,23 +16,3 @@ define i32 @test(i32* %P) {
define void @doesnotmodX() {
ret void
}
-
-declare void @InaccessibleMemOnlyFunc( ) #0
-declare void @InaccessibleMemOrArgMemOnlyFunc( ) #1
-
-define i32 @test2(i32* %P) {
-; CHECK: @test2
-; CHECK-NEXT: store i32 12, i32* @X
-; CHECK-NEXT: call void @InaccessibleMemOnlyFunc()
-; CHECK-NEXT: call void @InaccessibleMemOrArgMemOnlyFunc()
-; CHECK-NOT: load i32
-; CHECK-NEXT: ret i32 12
- store i32 12, i32* @X
- call void @InaccessibleMemOnlyFunc( )
- call void @InaccessibleMemOrArgMemOnlyFunc( )
- %V = load i32, i32* @X ; <i32> [#uses=1]
- ret i32 %V
-}
-
-attributes #0 = { inaccessiblememonly }
-attributes #1 = { inaccessiblemem_or_argmemonly }
OpenPOWER on IntegriCloud