summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/LoadVN
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2008-02-14 06:56:27 +0000
committerTanya Lattner <tonic@nondot.org>2008-02-14 06:56:27 +0000
commitf865dcd0092df9fdba44e8d1a996f1e1344760e5 (patch)
treef1c1e5741e4122faab02c26716711ae33be26665 /llvm/test/Analysis/LoadVN
parenteb63b0920667ad7fe87a6606dc73f58ecbebe027 (diff)
downloadbcm5719-llvm-f865dcd0092df9fdba44e8d1a996f1e1344760e5.tar.gz
bcm5719-llvm-f865dcd0092df9fdba44e8d1a996f1e1344760e5.zip
Remove llvm-upgrade.
llvm-svn: 47110
Diffstat (limited to 'llvm/test/Analysis/LoadVN')
-rw-r--r--llvm/test/Analysis/LoadVN/RLE-Eliminate.ll32
-rw-r--r--llvm/test/Analysis/LoadVN/RLE-Preserve-Volatile.ll13
-rw-r--r--llvm/test/Analysis/LoadVN/RLE-Preserve.ll37
-rw-r--r--llvm/test/Analysis/LoadVN/casts.ll14
-rw-r--r--llvm/test/Analysis/LoadVN/dependent_loads.ll42
-rw-r--r--llvm/test/Analysis/LoadVN/undefined_load.ll20
6 files changed, 79 insertions, 79 deletions
diff --git a/llvm/test/Analysis/LoadVN/RLE-Eliminate.ll b/llvm/test/Analysis/LoadVN/RLE-Eliminate.ll
index 4c3a668bc9b..ad9ba5e18e1 100644
--- a/llvm/test/Analysis/LoadVN/RLE-Eliminate.ll
+++ b/llvm/test/Analysis/LoadVN/RLE-Eliminate.ll
@@ -1,23 +1,25 @@
-; This testcase ensures that redundant loads are eliminated when they should
+; This testcase ensures that redundant loads are eliminated when they should
; be. All RL variables (redundant loads) should be eliminated.
;
-; RUN: llvm-upgrade < %s | llvm-as | opt -load-vn -gcse | llvm-dis | not grep %RL
+; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | not grep %RL
;
-int "test1"(int* %P) {
- %A = load int* %P
- %RL = load int* %P
- %C = add int %A, %RL
- ret int %C
+
+define i32 @test1(i32* %P) {
+ %A = load i32* %P ; <i32> [#uses=1]
+ %RL = load i32* %P ; <i32> [#uses=1]
+ %C = add i32 %A, %RL ; <i32> [#uses=1]
+ ret i32 %C
}
-int "test2"(int* %P) {
- %A = load int* %P
+define i32 @test2(i32* %P) {
+ %A = load i32* %P ; <i32> [#uses=1]
br label %BB2
-BB2:
+
+BB2: ; preds = %0
br label %BB3
-BB3:
- %RL = load int* %P
- %B = add int %A, %RL
- ret int %B
-}
+BB3: ; preds = %BB2
+ %RL = load i32* %P ; <i32> [#uses=1]
+ %B = add i32 %A, %RL ; <i32> [#uses=1]
+ ret i32 %B
+}
diff --git a/llvm/test/Analysis/LoadVN/RLE-Preserve-Volatile.ll b/llvm/test/Analysis/LoadVN/RLE-Preserve-Volatile.ll
index 99660168fb2..52968ea2c47 100644
--- a/llvm/test/Analysis/LoadVN/RLE-Preserve-Volatile.ll
+++ b/llvm/test/Analysis/LoadVN/RLE-Preserve-Volatile.ll
@@ -1,9 +1,8 @@
+; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | grep sub
-; RUN: llvm-upgrade < %s | llvm-as | opt -load-vn -gcse -instcombine | llvm-dis | grep sub
-
-int %test(int* %P) {
- %X = volatile load int* %P
- %Y = volatile load int* %P
- %Z = sub int %X, %Y
- ret int %Z
+define i32 @test(i32* %P) {
+ %X = volatile load i32* %P ; <i32> [#uses=1]
+ %Y = volatile load i32* %P ; <i32> [#uses=1]
+ %Z = sub i32 %X, %Y ; <i32> [#uses=1]
+ ret i32 %Z
}
diff --git a/llvm/test/Analysis/LoadVN/RLE-Preserve.ll b/llvm/test/Analysis/LoadVN/RLE-Preserve.ll
index e08c41ceeb8..f2c079488e9 100644
--- a/llvm/test/Analysis/LoadVN/RLE-Preserve.ll
+++ b/llvm/test/Analysis/LoadVN/RLE-Preserve.ll
@@ -1,25 +1,26 @@
-; This testcase ensures that redundant loads are preserved when they are not
+; This testcase ensures that redundant loads are preserved when they are not
; allowed to be eliminated.
-; RUN: llvm-upgrade < %s | llvm-as | opt -load-vn -gcse | llvm-dis | grep sub
+; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | grep sub
;
-int %test1(int* %P) {
- %A = load int* %P
- store int 1, int* %P
- %B = load int* %P
- %C = sub int %A, %B
- ret int %C
+
+define i32 @test1(i32* %P) {
+ %A = load i32* %P ; <i32> [#uses=1]
+ store i32 1, i32* %P
+ %B = load i32* %P ; <i32> [#uses=1]
+ %C = sub i32 %A, %B ; <i32> [#uses=1]
+ ret i32 %C
}
-int %test2(int* %P) {
- %A = load int* %P
+define i32 @test2(i32* %P) {
+ %A = load i32* %P ; <i32> [#uses=1]
br label %BB2
-BB2:
- store int 5, int* %P
- br label %BB3
-BB3:
- %B = load int* %P
- %C = sub int %A, %B
- ret int %C
-}
+BB2: ; preds = %0
+ store i32 5, i32* %P
+ br label %BB3
+BB3: ; preds = %BB2
+ %B = load i32* %P ; <i32> [#uses=1]
+ %C = sub i32 %A, %B ; <i32> [#uses=1]
+ ret i32 %C
+}
diff --git a/llvm/test/Analysis/LoadVN/casts.ll b/llvm/test/Analysis/LoadVN/casts.ll
index 3749bee3663..70e3fe56805 100644
--- a/llvm/test/Analysis/LoadVN/casts.ll
+++ b/llvm/test/Analysis/LoadVN/casts.ll
@@ -1,13 +1,13 @@
; Check to make sure that Value Numbering doesn't merge casts of different
; flavors.
-; RUN: llvm-upgrade < %s | llvm-as | opt -load-vn -gcse | llvm-dis | \
+; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | \
; RUN: grep {\[sz\]ext} | count 2
-declare void %external(int)
+declare void @external(i32)
-int %test_casts(short %x) {
- %a = sext short %x to int
- %b = zext short %x to int
- call void %external(int %a)
- ret int %b
+define i32 @test_casts(i16 %x) {
+ %a = sext i16 %x to i32 ; <i32> [#uses=1]
+ %b = zext i16 %x to i32 ; <i32> [#uses=1]
+ call void @external( i32 %a )
+ ret i32 %b
}
diff --git a/llvm/test/Analysis/LoadVN/dependent_loads.ll b/llvm/test/Analysis/LoadVN/dependent_loads.ll
index 168b640c9e7..1338a495b5f 100644
--- a/llvm/test/Analysis/LoadVN/dependent_loads.ll
+++ b/llvm/test/Analysis/LoadVN/dependent_loads.ll
@@ -1,27 +1,25 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub
+; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | \
+; RUN: llvm-dis | not grep sub
-%S = type { int, sbyte }
+%S = type { i32, i8 }
-sbyte %test(sbyte** %P) {
- %A = load sbyte** %P
- %B = load sbyte* %A
-
- %X = load sbyte** %P
- %Y = load sbyte* %X
-
- %R = sub sbyte %B, %Y
- ret sbyte %R
+define i8 @test(i8** %P) {
+ %A = load i8** %P ; <i8*> [#uses=1]
+ %B = load i8* %A ; <i8> [#uses=1]
+ %X = load i8** %P ; <i8*> [#uses=1]
+ %Y = load i8* %X ; <i8> [#uses=1]
+ %R = sub i8 %B, %Y ; <i8> [#uses=1]
+ ret i8 %R
}
-sbyte %test(%S ** %P) {
- %A = load %S** %P
- %B = getelementptr %S* %A, int 0, uint 1
- %C = load sbyte* %B
-
- %X = load %S** %P
- %Y = getelementptr %S* %X, int 0, uint 1
- %Z = load sbyte* %Y
-
- %R = sub sbyte %C, %Z
- ret sbyte %R
+define i8 @test1(%S** %P) {
+ %A = load %S** %P ; <%S*> [#uses=1]
+ %B = getelementptr %S* %A, i32 0, i32 1 ; <i8*> [#uses=1]
+ %C = load i8* %B ; <i8> [#uses=1]
+ %X = load %S** %P ; <%S*> [#uses=1]
+ %Y = getelementptr %S* %X, i32 0, i32 1 ; <i8*> [#uses=1]
+ %Z = load i8* %Y ; <i8> [#uses=1]
+ %R = sub i8 %C, %Z ; <i8> [#uses=1]
+ ret i8 %R
}
+
diff --git a/llvm/test/Analysis/LoadVN/undefined_load.ll b/llvm/test/Analysis/LoadVN/undefined_load.ll
index 8e4660c045d..ba6049ee310 100644
--- a/llvm/test/Analysis/LoadVN/undefined_load.ll
+++ b/llvm/test/Analysis/LoadVN/undefined_load.ll
@@ -1,14 +1,14 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -load-vn -gcse | llvm-dis | not grep load
+; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | not grep load
; Test that loads of undefined memory are eliminated.
-int %test1() {
- %X = malloc int
- %Y = load int* %X
- ret int %Y
-}
-int %test2() {
- %X = alloca int
- %Y = load int* %X
- ret int %Y
+define i32 @test1() {
+ %X = malloc i32 ; <i32*> [#uses=1]
+ %Y = load i32* %X ; <i32> [#uses=1]
+ ret i32 %Y
}
+define i32 @test2() {
+ %X = alloca i32 ; <i32*> [#uses=1]
+ %Y = load i32* %X ; <i32> [#uses=1]
+ ret i32 %Y
+}
OpenPOWER on IntegriCloud