summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorJiangning Liu <jiangning.liu@arm.com>2014-06-13 22:57:59 +0000
committerJiangning Liu <jiangning.liu@arm.com>2014-06-13 22:57:59 +0000
commit96e92c1d7529c094ee2f3a79e7a67faa0c5ea621 (patch)
treea18e4d09d736285bad3593d6b21c969f367ca449 /llvm/test/Transforms
parent3e61c523522d25f033d9663018ff7714d615e942 (diff)
downloadbcm5719-llvm-96e92c1d7529c094ee2f3a79e7a67faa0c5ea621.tar.gz
bcm5719-llvm-96e92c1d7529c094ee2f3a79e7a67faa0c5ea621.zip
Move GlobalMerge from Transform to CodeGen.
This patch is to move GlobalMerge pass from Transform/Scalar to CodeGen, because GlobalMerge depends on TargetMachine. In the mean time, the macro INITIALIZE_TM_PASS is also moved to CodeGen/Passes.h. With this fix we can avoid making libScalarOpts depend on libCodeGen. llvm-svn: 210951
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/GlobalMerge/AArch64/arm64.ll71
-rw-r--r--llvm/test/Transforms/GlobalMerge/AArch64/global-merge-1.ll22
-rw-r--r--llvm/test/Transforms/GlobalMerge/AArch64/global-merge-2.ll30
-rw-r--r--llvm/test/Transforms/GlobalMerge/AArch64/global-merge-3.ll27
-rw-r--r--llvm/test/Transforms/GlobalMerge/AArch64/lit.local.cfg3
-rw-r--r--llvm/test/Transforms/GlobalMerge/ARM/arm.ll55
-rw-r--r--llvm/test/Transforms/GlobalMerge/ARM/lit.local.cfg3
7 files changed, 0 insertions, 211 deletions
diff --git a/llvm/test/Transforms/GlobalMerge/AArch64/arm64.ll b/llvm/test/Transforms/GlobalMerge/AArch64/arm64.ll
deleted file mode 100644
index 9174f725740..00000000000
--- a/llvm/test/Transforms/GlobalMerge/AArch64/arm64.ll
+++ /dev/null
@@ -1,71 +0,0 @@
-; RUN: opt %s -mtriple=aarch64-linux-gnuabi -global-merge -S -o - | FileCheck %s
-
-; CHECK: @_MergedGlobals = internal global { [5 x i32], [5 x i32], [5 x i32] } zeroinitializer
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32:64-S128"
-target triple = "arm64-apple-ios7.0.0"
-
-@bar = internal global [5 x i32] zeroinitializer, align 4
-@baz = internal global [5 x i32] zeroinitializer, align 4
-@foo = internal global [5 x i32] zeroinitializer, align 4
-
-; Function Attrs: nounwind ssp
-define internal void @initialize() #0 {
- %1 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #2
- store i32 %1, i32* getelementptr inbounds ([5 x i32]* @bar, i64 0, i64 0), align 4
- %2 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #2
- store i32 %2, i32* getelementptr inbounds ([5 x i32]* @baz, i64 0, i64 0), align 4
- %3 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #2
- store i32 %3, i32* getelementptr inbounds ([5 x i32]* @bar, i64 0, i64 1), align 4
- %4 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #2
- store i32 %4, i32* getelementptr inbounds ([5 x i32]* @baz, i64 0, i64 1), align 4
- %5 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #2
- store i32 %5, i32* getelementptr inbounds ([5 x i32]* @bar, i64 0, i64 2), align 4
- %6 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #2
- store i32 %6, i32* getelementptr inbounds ([5 x i32]* @baz, i64 0, i64 2), align 4
- %7 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #2
- store i32 %7, i32* getelementptr inbounds ([5 x i32]* @bar, i64 0, i64 3), align 4
- %8 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #2
- store i32 %8, i32* getelementptr inbounds ([5 x i32]* @baz, i64 0, i64 3), align 4
- %9 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #2
- store i32 %9, i32* getelementptr inbounds ([5 x i32]* @bar, i64 0, i64 4), align 4
- %10 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #2
- store i32 %10, i32* getelementptr inbounds ([5 x i32]* @baz, i64 0, i64 4), align 4
- ret void
-}
-
-declare i32 @calc(...)
-
-; Function Attrs: nounwind ssp
-define internal void @calculate() #0 {
- %1 = load i32* getelementptr inbounds ([5 x i32]* @bar, i64 0, i64 0), align 4
- %2 = load i32* getelementptr inbounds ([5 x i32]* @baz, i64 0, i64 0), align 4
- %3 = mul nsw i32 %2, %1
- store i32 %3, i32* getelementptr inbounds ([5 x i32]* @foo, i64 0, i64 0), align 4
- %4 = load i32* getelementptr inbounds ([5 x i32]* @bar, i64 0, i64 1), align 4
- %5 = load i32* getelementptr inbounds ([5 x i32]* @baz, i64 0, i64 1), align 4
- %6 = mul nsw i32 %5, %4
- store i32 %6, i32* getelementptr inbounds ([5 x i32]* @foo, i64 0, i64 1), align 4
- %7 = load i32* getelementptr inbounds ([5 x i32]* @bar, i64 0, i64 2), align 4
- %8 = load i32* getelementptr inbounds ([5 x i32]* @baz, i64 0, i64 2), align 4
- %9 = mul nsw i32 %8, %7
- store i32 %9, i32* getelementptr inbounds ([5 x i32]* @foo, i64 0, i64 2), align 4
- %10 = load i32* getelementptr inbounds ([5 x i32]* @bar, i64 0, i64 3), align 4
- %11 = load i32* getelementptr inbounds ([5 x i32]* @baz, i64 0, i64 3), align 4
- %12 = mul nsw i32 %11, %10
- store i32 %12, i32* getelementptr inbounds ([5 x i32]* @foo, i64 0, i64 3), align 4
- %13 = load i32* getelementptr inbounds ([5 x i32]* @bar, i64 0, i64 4), align 4
- %14 = load i32* getelementptr inbounds ([5 x i32]* @baz, i64 0, i64 4), align 4
- %15 = mul nsw i32 %14, %13
- store i32 %15, i32* getelementptr inbounds ([5 x i32]* @foo, i64 0, i64 4), align 4
- ret void
-}
-
-; Function Attrs: nounwind readnone ssp
-define internal i32* @returnFoo() #1 {
- ret i32* getelementptr inbounds ([5 x i32]* @foo, i64 0, i64 0)
-}
-
-attributes #0 = { nounwind ssp }
-attributes #1 = { nounwind readnone ssp }
-attributes #2 = { nounwind }
diff --git a/llvm/test/Transforms/GlobalMerge/AArch64/global-merge-1.ll b/llvm/test/Transforms/GlobalMerge/AArch64/global-merge-1.ll
deleted file mode 100644
index f8854dd5456..00000000000
--- a/llvm/test/Transforms/GlobalMerge/AArch64/global-merge-1.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: opt %s -mtriple=aarch64-none-linux-gnu -global-merge -S -o - | FileCheck %s
-; RUN: opt %s -mtriple=aarch64-none-linux-gnu -global-merge -global-merge-on-external -S -o - | FileCheck %s
-
-; RUN: opt %s -mtriple=aarch64-linux-gnuabi -global-merge -S -o - | FileCheck %s
-; RUN: opt %s -mtriple=aarch64-linux-gnuabi -global-merge -global-merge-on-external -S -o - | FileCheck %s
-
-; RUN: opt %s -mtriple=aarch64-apple-ios -global-merge -S -o - | FileCheck %s
-; RUN: opt %s -mtriple=aarch64-apple-ios -global-merge -global-merge-on-external -S -o - | FileCheck %s
-
-@m = internal global i32 0, align 4
-@n = internal global i32 0, align 4
-
-; CHECK: @_MergedGlobals = internal global { i32, i32 } zeroinitializer
-
-define void @f1(i32 %a1, i32 %a2) {
-; CHECK-LABEL: @f1
-; CHECK: getelementptr inbounds ({ i32, i32 }* @_MergedGlobals, i32 0, i32 0)
-; CHECK: getelementptr inbounds ({ i32, i32 }* @_MergedGlobals, i32 0, i32 1)
- store i32 %a1, i32* @m, align 4
- store i32 %a2, i32* @n, align 4
- ret void
-}
diff --git a/llvm/test/Transforms/GlobalMerge/AArch64/global-merge-2.ll b/llvm/test/Transforms/GlobalMerge/AArch64/global-merge-2.ll
deleted file mode 100644
index 1876483882e..00000000000
--- a/llvm/test/Transforms/GlobalMerge/AArch64/global-merge-2.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: opt %s -mtriple=aarch64-none-linux-gnu -global-merge -global-merge-on-external -S -o - | FileCheck %s
-; RUN: opt %s -mtriple=aarch64-linux-gnuabi -global-merge -global-merge-on-external -S -o - | FileCheck %s
-; RUN: opt %s -mtriple=aarch64-apple-ios -global-merge -global-merge-on-external -S -o - | FileCheck %s
-
-@x = global i32 0, align 4
-@y = global i32 0, align 4
-@z = global i32 0, align 4
-
-; CHECK: @_MergedGlobals_x = global { i32, i32, i32 } zeroinitializer
-; CHECK: @x = alias getelementptr inbounds ({ i32, i32, i32 }* @_MergedGlobals_x, i32 0, i32 0)
-; CHECK: @y = alias getelementptr inbounds ({ i32, i32, i32 }* @_MergedGlobals_x, i32 0, i32 1)
-; CHECK: @z = alias getelementptr inbounds ({ i32, i32, i32 }* @_MergedGlobals_x, i32 0, i32 2)
-
-define void @f1(i32 %a1, i32 %a2) {
-; CHECK-LABEL: @f1
-; CHECK: getelementptr inbounds ({ i32, i32, i32 }* @_MergedGlobals_x, i32 0, i32 0)
-; CHECK: getelementptr inbounds ({ i32, i32, i32 }* @_MergedGlobals_x, i32 0, i32 1)
- store i32 %a1, i32* @x, align 4
- store i32 %a2, i32* @y, align 4
- ret void
-}
-
-define void @g1(i32 %a1, i32 %a2) {
-; CHECK-LABEL: @g1
-; CHECK: getelementptr inbounds ({ i32, i32, i32 }* @_MergedGlobals_x, i32 0, i32 1)
-; CHECK: getelementptr inbounds ({ i32, i32, i32 }* @_MergedGlobals_x, i32 0, i32 2)
- store i32 %a1, i32* @y, align 4
- store i32 %a2, i32* @z, align 4
- ret void
-}
diff --git a/llvm/test/Transforms/GlobalMerge/AArch64/global-merge-3.ll b/llvm/test/Transforms/GlobalMerge/AArch64/global-merge-3.ll
deleted file mode 100644
index 811c3eef13d..00000000000
--- a/llvm/test/Transforms/GlobalMerge/AArch64/global-merge-3.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: opt %s -mtriple=aarch64-none-linux-gnu -global-merge -global-merge-on-external -S -o - | FileCheck %s
-; RUN: opt %s -mtriple=aarch64-linux-gnuabi -global-merge -global-merge-on-external -S -o - | FileCheck %s
-; RUN: opt %s -mtriple=aarch64-apple-ios -global-merge -global-merge-on-external -S -o - | FileCheck %s
-
-@x = global [1000 x i32] zeroinitializer, align 1
-@y = global [1000 x i32] zeroinitializer, align 1
-@z = internal global i32 1, align 4
-
-; CHECK: @_MergedGlobals_x = global { i32, [1000 x i32] } { i32 1, [1000 x i32] zeroinitializer }
-; CHECK: @_MergedGlobals_y = global { [1000 x i32] } zeroinitializer
-
-; CHECK: @x = alias getelementptr inbounds ({ i32, [1000 x i32] }* @_MergedGlobals_x, i32 0, i32 1)
-; CHECK: @y = alias getelementptr inbounds ({ [1000 x i32] }* @_MergedGlobals_y, i32 0, i32 0)
-
-define void @f1(i32 %a1, i32 %a2, i32 %a3) {
-; CHECK-LABEL: @f1
-; CHECK: %x3 = getelementptr inbounds [1000 x i32]* getelementptr inbounds ({ i32, [1000 x i32] }* @_MergedGlobals_x, i32 0, i32 1), i32 0, i64 3
-; CHECK: %y3 = getelementptr inbounds [1000 x i32]* getelementptr inbounds ({ [1000 x i32] }* @_MergedGlobals_y, i32 0, i32 0), i32 0, i64 3
-; CHECK: store i32 %a3, i32* getelementptr inbounds ({ i32, [1000 x i32] }* @_MergedGlobals_x, i32 0, i32 0), align 4
-
- %x3 = getelementptr inbounds [1000 x i32]* @x, i32 0, i64 3
- %y3 = getelementptr inbounds [1000 x i32]* @y, i32 0, i64 3
- store i32 %a1, i32* %x3, align 4
- store i32 %a2, i32* %y3, align 4
- store i32 %a3, i32* @z, align 4
- ret void
-}
diff --git a/llvm/test/Transforms/GlobalMerge/AArch64/lit.local.cfg b/llvm/test/Transforms/GlobalMerge/AArch64/lit.local.cfg
deleted file mode 100644
index cec29af5bbe..00000000000
--- a/llvm/test/Transforms/GlobalMerge/AArch64/lit.local.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-if not 'AArch64' in config.root.targets:
- config.unsupported = True
-
diff --git a/llvm/test/Transforms/GlobalMerge/ARM/arm.ll b/llvm/test/Transforms/GlobalMerge/ARM/arm.ll
deleted file mode 100644
index e7553e91835..00000000000
--- a/llvm/test/Transforms/GlobalMerge/ARM/arm.ll
+++ /dev/null
@@ -1,55 +0,0 @@
-; RUN: opt %s -mtriple=arm-linux-gnuabi -global-merge -S -o - | FileCheck %s
-
-target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
-target triple = "thumbv7-apple-ios3.0.0"
-
-@bar = internal global [5 x i32] zeroinitializer, align 4
-@baz = internal global [5 x i32] zeroinitializer, align 4
-@foo = internal global [5 x i32] zeroinitializer, align 4
-
-; CHECK: @_MergedGlobals = internal global { [5 x i32], [5 x i32], [5 x i32] } zeroinitializer
-
-; Function Attrs: nounwind ssp
-define internal void @initialize() #0 {
- %1 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #3
- store i32 %1, i32* getelementptr inbounds ([5 x i32]* @bar, i32 0, i32 0), align 4
- %2 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #3
- store i32 %2, i32* getelementptr inbounds ([5 x i32]* @baz, i32 0, i32 0), align 4
- %3 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #3
- store i32 %3, i32* getelementptr inbounds ([5 x i32]* @bar, i32 0, i32 1), align 4
- %4 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #3
- store i32 %4, i32* getelementptr inbounds ([5 x i32]* @baz, i32 0, i32 1), align 4
- %5 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #3
- store i32 %5, i32* getelementptr inbounds ([5 x i32]* @bar, i32 0, i32 2), align 4
- %6 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #3
- store i32 %6, i32* getelementptr inbounds ([5 x i32]* @baz, i32 0, i32 2), align 4
- %7 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #3
- store i32 %7, i32* getelementptr inbounds ([5 x i32]* @bar, i32 0, i32 3), align 4
- %8 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #3
- store i32 %8, i32* getelementptr inbounds ([5 x i32]* @baz, i32 0, i32 3), align 4
- %9 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #3
- store i32 %9, i32* getelementptr inbounds ([5 x i32]* @bar, i32 0, i32 4), align 4
- %10 = tail call i32 bitcast (i32 (...)* @calc to i32 ()*)() #3
- store i32 %10, i32* getelementptr inbounds ([5 x i32]* @baz, i32 0, i32 4), align 4
- ret void
-}
-
-declare i32 @calc(...) #1
-
-; Function Attrs: nounwind ssp
-define internal void @calculate() #0 {
- %1 = load <4 x i32>* bitcast ([5 x i32]* @bar to <4 x i32>*), align 4
- %2 = load <4 x i32>* bitcast ([5 x i32]* @baz to <4 x i32>*), align 4
- %3 = mul <4 x i32> %2, %1
- store <4 x i32> %3, <4 x i32>* bitcast ([5 x i32]* @foo to <4 x i32>*), align 4
- %4 = load i32* getelementptr inbounds ([5 x i32]* @bar, i32 0, i32 4), align 4
- %5 = load i32* getelementptr inbounds ([5 x i32]* @baz, i32 0, i32 4), align 4
- %6 = mul nsw i32 %5, %4
- store i32 %6, i32* getelementptr inbounds ([5 x i32]* @foo, i32 0, i32 4), align 4
- ret void
-}
-
-; Function Attrs: nounwind readnone ssp
-define internal i32* @returnFoo() #2 {
- ret i32* getelementptr inbounds ([5 x i32]* @foo, i32 0, i32 0)
-}
diff --git a/llvm/test/Transforms/GlobalMerge/ARM/lit.local.cfg b/llvm/test/Transforms/GlobalMerge/ARM/lit.local.cfg
deleted file mode 100644
index 98c6700c209..00000000000
--- a/llvm/test/Transforms/GlobalMerge/ARM/lit.local.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-if not 'ARM' in config.root.targets:
- config.unsupported = True
-
OpenPOWER on IntegriCloud