summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/GlobalDCE
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2019-04-17 02:12:23 +0000
committerEric Christopher <echristo@gmail.com>2019-04-17 02:12:23 +0000
commita86343512845c9c1fdbac865fea88aa5fce7142a (patch)
tree666fc6353de19ad8b00e56b67edd33f24104e4a7 /llvm/test/Transforms/GlobalDCE
parent7f8ca6e3679b3af951cb7a4b1377edfaa3244b93 (diff)
downloadbcm5719-llvm-a86343512845c9c1fdbac865fea88aa5fce7142a.tar.gz
bcm5719-llvm-a86343512845c9c1fdbac865fea88aa5fce7142a.zip
Temporarily Revert "Add basic loop fusion pass."
As it's causing some bot failures (and per request from kbarton). This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda. llvm-svn: 358546
Diffstat (limited to 'llvm/test/Transforms/GlobalDCE')
-rw-r--r--llvm/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll11
-rw-r--r--llvm/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll13
-rw-r--r--llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll18
-rw-r--r--llvm/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll14
-rw-r--r--llvm/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll11
-rw-r--r--llvm/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll13
-rw-r--r--llvm/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll6
-rw-r--r--llvm/test/Transforms/GlobalDCE/2009-01-05-DeadAliases.ll18
-rw-r--r--llvm/test/Transforms/GlobalDCE/2009-02-17-AliasUsesAliasee.ll4
-rw-r--r--llvm/test/Transforms/GlobalDCE/basicvariabletest.ll6
-rw-r--r--llvm/test/Transforms/GlobalDCE/comdats.ll178
-rw-r--r--llvm/test/Transforms/GlobalDCE/complex-constantexpr.ll97
-rw-r--r--llvm/test/Transforms/GlobalDCE/crash-assertingvh.ll24
-rw-r--r--llvm/test/Transforms/GlobalDCE/deadblockaddr.ll16
-rw-r--r--llvm/test/Transforms/GlobalDCE/externally_available.ll21
-rw-r--r--llvm/test/Transforms/GlobalDCE/global-ifunc.ll13
-rw-r--r--llvm/test/Transforms/GlobalDCE/global_ctors.ll37
-rw-r--r--llvm/test/Transforms/GlobalDCE/global_ctors_integration.ll45
-rw-r--r--llvm/test/Transforms/GlobalDCE/indirectbr.ll18
19 files changed, 0 insertions, 563 deletions
diff --git a/llvm/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll b/llvm/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll
deleted file mode 100644
index 37356f25948..00000000000
--- a/llvm/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: opt < %s -globaldce
-;
-define internal void @func() {
- ret void
-}
-
-define void @main() {
- %X = bitcast void ()* @func to i32* ; <i32*> [#uses=0]
- ret void
-}
-
diff --git a/llvm/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll b/llvm/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll
deleted file mode 100644
index 740f7201a34..00000000000
--- a/llvm/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: opt < %s -globaldce
-;
-
-@X = global void ()* @func ; <void ()**> [#uses=0]
-
-; Not dead, can be reachable via X
-define internal void @func() {
- ret void
-}
-
-define void @main() {
- ret void
-}
diff --git a/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll b/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
deleted file mode 100644
index 3da0fd5f14b..00000000000
--- a/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; Make sure that functions are removed successfully if they are referred to by
-; a global that is dead. Make sure any globals they refer to die as well.
-
-; RUN: opt < %s -globaldce -S | FileCheck %s
-
-; CHECK-NOT: foo
-;; Unused, kills %foo
-@b = internal global i32 ()* @foo ; <i32 ()**> [#uses=0]
-
-;; Should die when function %foo is killed
-@foo.upgrd.1 = internal global i32 7 ; <i32*> [#uses=1]
-
- ;; dies when %b dies.
-define internal i32 @foo() {
- %ret = load i32, i32* @foo.upgrd.1 ; <i32> [#uses=1]
- ret i32 %ret
-}
-
diff --git a/llvm/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll b/llvm/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll
deleted file mode 100644
index 4e45e2bb468..00000000000
--- a/llvm/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; This testcase tests that a worklist is being used, and that globals can be
-; removed if they are the subject of a constexpr and ConstantPointerRef
-
-; RUN: opt < %s -globaldce -S | FileCheck %s
-
-; CHECK-NOT: global
-
-@t0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1]
-@t1 = internal global [4 x i8] c"bar\00" ; <[4 x i8]*> [#uses=1]
-@s1 = internal global [1 x i8*] [ i8* getelementptr ([4 x i8], [4 x i8]* @t0, i32 0, i32 0) ] ; <[1 x i8*]*> [#uses=0]
-@s2 = internal global [1 x i8*] [ i8* getelementptr ([4 x i8], [4 x i8]* @t1, i64 0, i64 0) ] ; <[1 x i8*]*> [#uses=0]
-@b = internal global i32* @a ; <i32**> [#uses=0]
-@a = internal global i32 7 ; <i32*> [#uses=1]
-
diff --git a/llvm/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll b/llvm/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll
deleted file mode 100644
index afa2629f8f6..00000000000
--- a/llvm/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: opt < %s -globaldce
-
-;; Should die when function %foo is killed
-@foo.upgrd.1 = internal global i32 7 ; <i32*> [#uses=3]
-@bar = internal global [2 x { i32*, i32 }] [ { i32*, i32 } { i32* @foo.upgrd.1, i32 7 }, { i32*, i32 } { i32* @foo.upgrd.1, i32 1 } ] ; <[2 x { i32*, i32 }]*> [#uses=0]
-
-define internal i32 @foo() {
- %ret = load i32, i32* @foo.upgrd.1 ; <i32> [#uses=1]
- ret i32 %ret
-}
-
diff --git a/llvm/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll b/llvm/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll
deleted file mode 100644
index 0b1b2792453..00000000000
--- a/llvm/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; distilled from 255.vortex
-; RUN: opt < %s -globaldce -S | FileCheck %s
-
-; CHECK-NOT: testfunc
-
-declare i1 ()* @getfunc()
-
-define internal i1 @testfunc() {
- %F = call i1 ()* () @getfunc( ) ; <i1 ()*> [#uses=1]
- %c = icmp eq i1 ()* %F, @testfunc ; <i1> [#uses=1]
- ret i1 %c
-}
-
diff --git a/llvm/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll b/llvm/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll
deleted file mode 100644
index ded31659721..00000000000
--- a/llvm/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; Weak variables should be preserved by global DCE!
-
-; RUN: opt < %s -globaldce -S | FileCheck %s
-
-; CHECK: @A
-@A = weak global i32 54
diff --git a/llvm/test/Transforms/GlobalDCE/2009-01-05-DeadAliases.ll b/llvm/test/Transforms/GlobalDCE/2009-01-05-DeadAliases.ll
deleted file mode 100644
index c62ec10df79..00000000000
--- a/llvm/test/Transforms/GlobalDCE/2009-01-05-DeadAliases.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: opt < %s -globaldce -S > %t
-; RUN: FileCheck %s < %t
-; RUN: FileCheck --check-prefix=DEAD %s < %t
-
-@A = global i32 0
-; CHECK: @A = global i32 0
-
-@D = internal alias i32, i32* @A
-; DEAD-NOT: @D
-
-@L1 = alias i32, i32* @A
-; CHECK: @L1 = alias i32, i32* @A
-
-@L2 = internal alias i32, i32* @L1
-; CHECK: @L2 = internal alias i32, i32* @L1
-
-@L3 = alias i32, i32* @L2
-; CHECK: @L3 = alias i32, i32* @L2
diff --git a/llvm/test/Transforms/GlobalDCE/2009-02-17-AliasUsesAliasee.ll b/llvm/test/Transforms/GlobalDCE/2009-02-17-AliasUsesAliasee.ll
deleted file mode 100644
index 17474888d79..00000000000
--- a/llvm/test/Transforms/GlobalDCE/2009-02-17-AliasUsesAliasee.ll
+++ /dev/null
@@ -1,4 +0,0 @@
-; RUN: opt < %s -globaldce
-
-@A = internal alias void (), void ()* @F
-define internal void @F() { ret void }
diff --git a/llvm/test/Transforms/GlobalDCE/basicvariabletest.ll b/llvm/test/Transforms/GlobalDCE/basicvariabletest.ll
deleted file mode 100644
index ae8ce3f7fd0..00000000000
--- a/llvm/test/Transforms/GlobalDCE/basicvariabletest.ll
+++ /dev/null
@@ -1,6 +0,0 @@
-; RUN: opt < %s -passes=globaldce -S | FileCheck %s
-
-; CHECK-NOT: global
-@X = external global i32
-@Y = internal global i32 7
-
diff --git a/llvm/test/Transforms/GlobalDCE/comdats.ll b/llvm/test/Transforms/GlobalDCE/comdats.ll
deleted file mode 100644
index 29ef848a586..00000000000
--- a/llvm/test/Transforms/GlobalDCE/comdats.ll
+++ /dev/null
@@ -1,178 +0,0 @@
-; Test the behavior of GlobalDCE in conjunction with comdats.
-;
-; RUN: opt < %s -globaldce -S | FileCheck %s
-
-; First test checks that if one function in a comdat group is used, both other
-; functions and other globals even if unused will be preserved.
-$test1_c = comdat any
-; CHECK: $test1_c = comdat any
-
-; Second test checks that if one function in a comdat group is used, both other
-; functions and other globals even if unused will be preserved.
-$test2_c = comdat any
-; CHECK: $test2_c = comdat any
-
-; Third test checks that calling a function in a comdat group with an alias
-; preserves the alias.
-$test3_c = comdat any
-; CHECK: $test3_c = comdat any
-
-; Fourth test checks that calling an alias in a comdat group with a function
-; preserves the function. (This is the trivial case as the alias uses the
-; function.)
-$test4_c = comdat any
-; CHECK: $test4_c = comdat any
-
-; Fifth test checks that calling a function in a comdat group that is used as
-; the resolver of an ifunc doesn't preserve that ifunc. ifunc symbols don't
-; participate in the comdat group of their resolver function as they are
-; considered separate objects.
-$test5_c = comdat any
-; CHECK: $test5_c = comdat any
-
-; Sixth test checks that calling an ifunc whose resolver is in a comdat group
-; preserves the resolver. This is the trivial case as the ifunc uses the
-; resolver.
-$test6_c = comdat any
-; CHECK: $test6_c = comdat any
-
-; Seventh test checks that we can eliminate a comdat when it has only one dead function participant.
-$test7_c = comdat any
-; CHECK-NOT: $test7_c = comdat any
-
-; Eighth test checks that we can eliminate a comdat when it has only one dead global participant.
-$test8_c = comdat any
-; CHECK-NOT: $test8_c = comdat any
-
-; Ninth test checks that we can eliminate a comdat when there are multiple
-; dead participants.
-$test9_c = comdat any
-; CHECK-NOT: $test9_c = comdat any
-
-; Tenth test checks that we can eliminate a comdat when it has multiple
-; participants that form internal cyclic uses but are never used externally and
-; thus the entire ifunc can safely be eliminated.
-$test10_c = comdat any
-; CHECK-NOT: $test10_c = comdat any
-
-@test1_gv = linkonce_odr unnamed_addr global i32 42, comdat($test1_c)
-; CHECK: @test1_gv = linkonce_odr unnamed_addr global
-
-@test2_used = linkonce_odr unnamed_addr global i32 42, comdat($test2_c)
-; CHECK: @test2_used = linkonce_odr unnamed_addr global
-
-@test2_gv = linkonce_odr unnamed_addr global i32 42, comdat($test2_c)
-; CHECK: @test2_gv = linkonce_odr unnamed_addr global
-
-@test8_gv = linkonce_odr unnamed_addr global i32 42, comdat($test8_c)
-; CHECK-NOT: @test8_gv
-
-@test9_gv = linkonce_odr unnamed_addr global i32 42, comdat($test9_c)
-; CHECK-NOT: @test9_gv
-
-@test10_gv = linkonce_odr unnamed_addr global void ()* @test10_f, comdat($test10_c)
-; CHECK-NOT: @test10_gv
-
-@test3_a = linkonce_odr unnamed_addr alias void (), void ()* @test3_f
-; CHECK: @test3_a = linkonce_odr unnamed_addr alias
-
-@test4_a = linkonce_odr unnamed_addr alias void (), void ()* @test4_f
-; CHECK: @test4_a = linkonce_odr unnamed_addr alias
-
-@test10_a = linkonce_odr unnamed_addr alias void (), void ()* @test10_g
-; CHECK-NOT: @test10_a
-
-@test5_if = linkonce_odr ifunc void (), void ()* ()* @test5_f
-; CHECK-NOT: @test5_if
-
-@test6_if = linkonce_odr ifunc void (), void ()* ()* @test6_f
-; CHECK: @test6_if = linkonce_odr ifunc
-
-; This function is directly used and so cannot be eliminated.
-define linkonce_odr void @test1_used() comdat($test1_c) {
-; CHECK: define linkonce_odr void @test1_used()
-entry:
- ret void
-}
-
-define linkonce_odr void @test1_f() comdat($test1_c) {
-; CHECK: define linkonce_odr void @test1_f()
-entry:
- ret void
-}
-
-; Now test that a function, global variable, alias, and ifunc in the same
-; comdat are kept.
-define linkonce_odr void @test2_f() comdat($test2_c) {
-; CHECK: define linkonce_odr void @test2_f()
-entry:
- ret void
-}
-
-define linkonce_odr void @test3_f() comdat($test3_c) {
-; CHECK: define linkonce_odr void @test3_f()
-entry:
- ret void
-}
-
-define linkonce_odr void @test4_f() comdat($test4_c) {
-; CHECK: define linkonce_odr void @test4_f()
-entry:
- ret void
-}
-
-declare void @test_external()
-
-define linkonce_odr void ()* @test5_f() comdat($test5_c) {
-; CHECK: define linkonce_odr void ()* @test5_f()
-entry:
- ret void ()* @test_external
-}
-
-define linkonce_odr void ()* @test6_f() comdat($test6_c) {
-; CHECK: define linkonce_odr void ()* @test6_f()
-entry:
- ret void ()* @test_external
-}
-
-define linkonce_odr void @test7_f() comdat($test7_c) {
-; CHECK-NOT: @test7_f
-entry:
- ret void
-}
-
-define linkonce_odr void @test9_f() comdat($test9_c) {
-; CHECK-NOT: @test9_f
-entry:
- ret void
-}
-
-define linkonce_odr void @test10_f() comdat($test10_c) {
-; CHECK-NOT: @test10_f
-entry:
- %gv = load void ()*, void ()** @test10_gv
- call void @test10_a()
- ret void
-}
-
-define linkonce_odr void @test10_g() comdat($test10_c) {
-; CHECK-NOT: @test10_g
-entry:
- call void @test10_f()
- ret void
-}
-
-
-; An external function to pin as "used" various things above that shouldn't be
-; eliminated.
-define void @external_user() {
- call void @test1_used()
- %gv = load i32, i32* @test2_used
-
- call void @test3_f()
- call void @test4_a()
-
- %fptr = call void() *@test5_f()
- call void @test6_if()
- ret void
-}
diff --git a/llvm/test/Transforms/GlobalDCE/complex-constantexpr.ll b/llvm/test/Transforms/GlobalDCE/complex-constantexpr.ll
deleted file mode 100644
index b4eed02eff2..00000000000
--- a/llvm/test/Transforms/GlobalDCE/complex-constantexpr.ll
+++ /dev/null
@@ -1,97 +0,0 @@
-; RUN: opt -O2 -disable-output < %s
-; PR15714
-
-%struct.ham = type { i32 }
-
-@global5 = common global i32 0, align 4
-@global6 = common global i32 0, align 4
-@global7 = common global i32 0, align 4
-@global = common global i32 0, align 4
-@global8 = common global %struct.ham zeroinitializer, align 4
-@global9 = common global i32 0, align 4
-@global10 = common global i32 0, align 4
-@global11 = common global i32 0, align 4
-
-define void @zot12() {
-bb:
- store i32 0, i32* @global5, align 4
- store i32 0, i32* @global6, align 4
- br label %bb2
-
-bb1: ; preds = %bb11
- %tmp = load i32, i32* @global5, align 4
- br label %bb2
-
-bb2: ; preds = %bb1, %bb
- %tmp3 = phi i32 [ %tmp, %bb1 ], [ 0, %bb ]
- %tmp4 = xor i32 %tmp3, zext (i1 icmp ne (i64 ptrtoint (i32* @global5 to i64), i64 1) to i32)
- store i32 %tmp4, i32* @global5, align 4
- %tmp5 = icmp eq i32 %tmp3, zext (i1 icmp ne (i64 ptrtoint (i32* @global5 to i64), i64 1) to i32)
- br i1 %tmp5, label %bb8, label %bb6
-
-bb6: ; preds = %bb2
- %tmp7 = tail call i32 @quux13()
- br label %bb8
-
-bb8: ; preds = %bb6, %bb2
- %tmp9 = load i32, i32* @global7, align 4
- %tmp10 = icmp eq i32 %tmp9, 0
- br i1 %tmp10, label %bb11, label %bb15
-
-bb11: ; preds = %bb8
- %tmp12 = load i32, i32* @global6, align 4
- %tmp13 = add nsw i32 %tmp12, 1
- store i32 %tmp13, i32* @global6, align 4
- %tmp14 = icmp slt i32 %tmp13, 42
- br i1 %tmp14, label %bb1, label %bb15
-
-bb15: ; preds = %bb11, %bb8
- ret void
-}
-
-define i32 @quux13() {
-bb:
- store i32 1, i32* @global5, align 4
- ret i32 1
-}
-
-define void @wombat() {
-bb:
- tail call void @zot12()
- ret void
-}
-
-define void @wombat14() {
-bb:
- tail call void @blam()
- ret void
-}
-
-define void @blam() {
-bb:
- store i32 ptrtoint (i32* @global to i32), i32* getelementptr inbounds (%struct.ham, %struct.ham* @global8, i64 0, i32 0), align 4
- store i32 0, i32* @global9, align 4
- %tmp = load i32, i32* getelementptr inbounds (%struct.ham, %struct.ham* @global8, i64 0, i32 0), align 4
- br label %bb1
-
-bb1: ; preds = %bb1, %bb
- %tmp2 = phi i32 [ 0, %bb ], [ %tmp11, %bb1 ]
- %tmp3 = phi i32 [ %tmp, %bb ], [ %tmp10, %bb1 ]
- %tmp4 = icmp sgt i32 %tmp3, 0
- %tmp5 = zext i1 %tmp4 to i32
- %tmp6 = urem i32 %tmp5, 5
- %tmp7 = mul i32 %tmp3, -80
- %tmp8 = or i32 %tmp7, %tmp6
- %tmp9 = icmp eq i32 %tmp8, 0
- %tmp10 = zext i1 %tmp9 to i32
- %tmp11 = add nsw i32 %tmp2, 1
- %tmp12 = icmp eq i32 %tmp11, 20
- br i1 %tmp12, label %bb13, label %bb1
-
-bb13: ; preds = %bb1
- store i32 %tmp10, i32* getelementptr inbounds (%struct.ham, %struct.ham* @global8, i64 0, i32 0), align 4
- store i32 0, i32* @global10, align 4
- store i32 %tmp6, i32* @global11, align 4
- store i32 20, i32* @global9, align 4
- ret void
-}
diff --git a/llvm/test/Transforms/GlobalDCE/crash-assertingvh.ll b/llvm/test/Transforms/GlobalDCE/crash-assertingvh.ll
deleted file mode 100644
index 2919999d5e2..00000000000
--- a/llvm/test/Transforms/GlobalDCE/crash-assertingvh.ll
+++ /dev/null
@@ -1,24 +0,0 @@
-; Make sure that if a pass like jump threading populates a function analysis
-; like LVI with asserting handles into the body of a function, those don't begin
-; to assert when global DCE deletes the body of the function.
-;
-; RUN: opt -disable-output < %s -passes='module(function(jump-threading),globaldce)'
-; RUN: opt -disable-output < %s -passes='module(rpo-functionattrs,globaldce)'
-
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
-
-declare i32 @bar()
-
-define internal i32 @foo() {
-entry:
- %call4 = call i32 @bar()
- %cmp5 = icmp eq i32 %call4, 0
- br i1 %cmp5, label %if.then6, label %if.end8
-
-if.then6:
- ret i32 0
-
-if.end8:
- ret i32 1
-}
diff --git a/llvm/test/Transforms/GlobalDCE/deadblockaddr.ll b/llvm/test/Transforms/GlobalDCE/deadblockaddr.ll
deleted file mode 100644
index 1ec5994d004..00000000000
--- a/llvm/test/Transforms/GlobalDCE/deadblockaddr.ll
+++ /dev/null
@@ -1,16 +0,0 @@
-; RUN: opt -globaldce -simplifycfg -S < %s | FileCheck %s
-
-; Tests whether globaldce does the right cleanup while removing @bar
-; so that a dead BlockAddress reference to foo won't prevent other passes
-; to work properly, e.g. simplifycfg
-@bar = internal unnamed_addr constant i8* blockaddress(@foo, %L1)
-
-; CHECK-LABEL: foo
-; CHECK-NOT: br label %L1
-; CHECK: ret void
-define void @foo() {
-entry:
- br label %L1
-L1:
- ret void
-}
diff --git a/llvm/test/Transforms/GlobalDCE/externally_available.ll b/llvm/test/Transforms/GlobalDCE/externally_available.ll
deleted file mode 100644
index bc54db38cee..00000000000
--- a/llvm/test/Transforms/GlobalDCE/externally_available.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; RUN: opt < %s -globaldce -S | FileCheck %s
-
-; test_global should not be emitted to the .s file.
-; CHECK-NOT: @test_global =
-@test_global = available_externally global i32 4
-
-; test_global2 is a normal global using an available externally function.
-; CHECK: @test_global2 =
-@test_global2 = global i32 ()* @test_function2
-
-; test_function should not be emitted to the .s file.
-; CHECK-NOT: define {{.*}} @test_function()
-define available_externally i32 @test_function() {
- ret i32 4
-}
-
-; test_function2 isn't actually dead even though it's available externally.
-; CHECK: define available_externally i32 @test_function2()
-define available_externally i32 @test_function2() {
- ret i32 4
-}
diff --git a/llvm/test/Transforms/GlobalDCE/global-ifunc.ll b/llvm/test/Transforms/GlobalDCE/global-ifunc.ll
deleted file mode 100644
index 8022452c348..00000000000
--- a/llvm/test/Transforms/GlobalDCE/global-ifunc.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: opt -S -globaldce < %s | FileCheck %s
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
-
-@if = ifunc void (), void ()* @fn
-
-define internal void @fn() {
-entry:
- ret void
-}
-
-; CHECK-DAG: @if = ifunc void (), void ()* @fn
-; CHECK-DAG: define internal void @fn(
diff --git a/llvm/test/Transforms/GlobalDCE/global_ctors.ll b/llvm/test/Transforms/GlobalDCE/global_ctors.ll
deleted file mode 100644
index bd1a97e6ec2..00000000000
--- a/llvm/test/Transforms/GlobalDCE/global_ctors.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: opt -S -globaldce < %s | FileCheck %s
-
-; Test that the presence of debug intrinsics isn't affecting GlobalDCE.
-; CHECK: @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_notremovable }]
-; CHECK-NOT: @_GLOBAL__I_a
-
-declare void @_notremovable()
-
-@llvm.global_ctors = appending global [3 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_b }, { i32, void ()* } { i32 65535, void ()* @_notremovable }]
-
-@x = internal unnamed_addr constant i8 undef, align 1
-
-; Function Attrs: nounwind readnone
-define internal void @_GLOBAL__I_a() #1 section "__TEXT,__StaticInit,regular,pure_instructions" {
-entry:
- ret void
-}
-
-; Function Attrs: nounwind readnone
-define internal void @_GLOBAL__I_b() #1 section "__TEXT,__StaticInit,regular,pure_instructions" {
-entry:
- tail call void @llvm.dbg.value(metadata i8* @x, metadata !4, metadata !DIExpression(DW_OP_deref, DW_OP_constu, 0, DW_OP_swap, DW_OP_xderef)), !dbg !5
- ret void
-}
-
-; Function Attrs: nounwind readnone speculatable
-declare void @llvm.dbg.value(metadata, metadata, metadata)
-
-!llvm.module.flags = !{!0}
-!llvm.dbg.cu = !{!1}
-
-!0 = !{i32 2, !"Debug Info Version", i32 3}
-!1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, emissionKind: FullDebug)
-!2 = !DIFile(filename: "filename", directory: "directory")
-!3 = distinct !DISubprogram(name: "h1", unit: !1)
-!4 = !DILocalVariable(name: "b", arg: 1, scope: !3)
-!5 = !DILocation(scope: !3)
diff --git a/llvm/test/Transforms/GlobalDCE/global_ctors_integration.ll b/llvm/test/Transforms/GlobalDCE/global_ctors_integration.ll
deleted file mode 100644
index f7f702a980d..00000000000
--- a/llvm/test/Transforms/GlobalDCE/global_ctors_integration.ll
+++ /dev/null
@@ -1,45 +0,0 @@
-; RUN: opt -S -O2 < %s | FileCheck %s
-
-; This test checks that -O2 is able to delete constructors that become empty
-; only after some optimization passes have run, even if the pass structure
-; changes.
-; CHECK-NOT: @_GLOBAL__I_a
-
-%class.Foo = type { i32 }
-
-@foo = global %class.Foo zeroinitializer, align 4
-@_ZN3Bar18LINKER_INITIALIZEDE = external constant i32
-@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }]
-
-define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" {
- %1 = load i32, i32* @_ZN3Bar18LINKER_INITIALIZEDE, align 4
- call void @_ZN3FooC1E17LinkerInitialized(%class.Foo* @foo, i32 %1)
- ret void
-}
-
-; Function Attrs: ssp uwtable
-define linkonce_odr void @_ZN3FooC1E17LinkerInitialized(%class.Foo* %this, i32) unnamed_addr #0 align 2 {
- %2 = alloca %class.Foo*, align 8
- %3 = alloca i32, align 4
- store %class.Foo* %this, %class.Foo** %2, align 8
- store i32 %0, i32* %3, align 4
- %4 = load %class.Foo*, %class.Foo** %2
- %5 = load i32, i32* %3, align 4
- call void @_ZN3FooC2E17LinkerInitialized(%class.Foo* %4, i32 %5)
- ret void
-}
-
-; Function Attrs: nounwind ssp uwtable
-define linkonce_odr void @_ZN3FooC2E17LinkerInitialized(%class.Foo* %this, i32) unnamed_addr #1 align 2 {
- %2 = alloca %class.Foo*, align 8
- %3 = alloca i32, align 4
- store %class.Foo* %this, %class.Foo** %2, align 8
- store i32 %0, i32* %3, align 4
- %4 = load %class.Foo*, %class.Foo** %2
- ret void
-}
-
-define internal void @_GLOBAL__I_a() section "__TEXT,__StaticInit,regular,pure_instructions" {
- call void @__cxx_global_var_init()
- ret void
-}
diff --git a/llvm/test/Transforms/GlobalDCE/indirectbr.ll b/llvm/test/Transforms/GlobalDCE/indirectbr.ll
deleted file mode 100644
index 5671aea943f..00000000000
--- a/llvm/test/Transforms/GlobalDCE/indirectbr.ll
+++ /dev/null
@@ -1,18 +0,0 @@
-; RUN: opt -S -globaldce < %s | FileCheck %s
-
-@L = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@test1, %L1), i8* blockaddress(@test1, %L2), i8* null], align 16
-
-; CHECK: @L = internal unnamed_addr constant
-
-define void @test1(i32 %idx) {
-entry:
- br label %L1
-
-L1:
- %arrayidx = getelementptr inbounds [3 x i8*], [3 x i8*]* @L, i32 0, i32 %idx
- %l = load i8*, i8** %arrayidx
- indirectbr i8* %l, [label %L1, label %L2]
-
-L2:
- ret void
-}
OpenPOWER on IntegriCloud