summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ConstantMerge
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-12 18:17:23 +0000
committerChris Lattner <sabre@nondot.org>2010-02-12 18:17:23 +0000
commit75879be9d8a0fad258ce9a391cbe4c3b14dc822c (patch)
treebf5ab4cc9aac7e470e76641b3c9ccfabc3b20d76 /llvm/test/Transforms/ConstantMerge
parent0760481f268cf59cba67f8669eb1e74a3a801201 (diff)
downloadbcm5719-llvm-75879be9d8a0fad258ce9a391cbe4c3b14dc822c.tar.gz
bcm5719-llvm-75879be9d8a0fad258ce9a391cbe4c3b14dc822c.zip
1. modernize the constantmerge pass, using densemap/smallvector.
2. don't bother trying to merge globals in non-default sections, doing so is quite dubious at best anyway. 3. fix a bug reported by Arnaud de Grandmaison where we'd try to merge two globals in different address spaces. llvm-svn: 95995
Diffstat (limited to 'llvm/test/Transforms/ConstantMerge')
-rw-r--r--llvm/test/Transforms/ConstantMerge/dont-merge.ll34
1 files changed, 24 insertions, 10 deletions
diff --git a/llvm/test/Transforms/ConstantMerge/dont-merge.ll b/llvm/test/Transforms/ConstantMerge/dont-merge.ll
index cea18a05efb..877cf8dc671 100644
--- a/llvm/test/Transforms/ConstantMerge/dont-merge.ll
+++ b/llvm/test/Transforms/ConstantMerge/dont-merge.ll
@@ -1,16 +1,30 @@
-; RUN: opt < %s -constmerge -S | grep foo
-; RUN: opt < %s -constmerge -S | grep bar
+; RUN: opt < %s -constmerge -S | FileCheck %s
-; Don't merge constants in different sections.
+; Don't merge constants with specified sections.
-@G1 = internal constant i32 1, section "foo" ; <i32*> [#uses=1]
-@G2 = internal constant i32 1, section "bar" ; <i32*> [#uses=1]
-@G3 = internal constant i32 1, section "bar" ; <i32*> [#uses=1]
+@T1G1 = internal constant i32 1, section "foo"
+@T1G2 = internal constant i32 1, section "bar"
+@T1G3 = internal constant i32 1, section "bar"
-define void @test(i32** %P1, i32** %P2, i32** %P3) {
- store i32* @G1, i32** %P1
- store i32* @G2, i32** %P2
- store i32* @G3, i32** %P3
+; CHECK: @T1G1
+; CHECK: @T1G2
+; CHECK: @T1G3
+
+define void @test1(i32** %P1, i32** %P2, i32** %P3) {
+ store i32* @T1G1, i32** %P1
+ store i32* @T1G2, i32** %P2
+ store i32* @T1G3, i32** %P3
ret void
}
+@T2a = internal constant i32 224
+@T2b = internal addrspace(30) constant i32 224
+
+; CHECK: @T2a
+; CHECK: @T2b
+
+define void @test2(i32** %P1, i32 addrspace(30)** %P2) {
+ store i32* @T2a, i32** %P1
+ store i32 addrspace(30)* @T2b, i32 addrspace(30)** %P2
+ ret void
+}
OpenPOWER on IntegriCloud