aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-07-03 23:51:19 +0000
committerOwen Anderson <resistor@mac.com>2007-07-03 23:51:19 +0000
commit5653322e729fd2016556fd1d5e54cde20d3012d8 (patch)
tree5cdf0bcc00c36668ffe1e4c110788a6cd8095b06 /test/Transforms
parent3c94f6ae077dcc48eff681097241b47b24b7b70b (diff)
downloadexternal_llvm-5653322e729fd2016556fd1d5e54cde20d3012d8.zip
external_llvm-5653322e729fd2016556fd1d5e54cde20d3012d8.tar.gz
external_llvm-5653322e729fd2016556fd1d5e54cde20d3012d8.tar.bz2
Add support for performing GVNPRE on GEP instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/GVNPRE/gep.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/GVNPRE/gep.ll b/test/Transforms/GVNPRE/gep.ll
new file mode 100644
index 0000000..34bc4c7
--- /dev/null
+++ b/test/Transforms/GVNPRE/gep.ll
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | opt -gvnpre | llvm-dis | grep b.gvnpre
+
+define i32 @extract({ i32 }* %P) {
+entry: ; preds = %cond_false, %entry
+ br i1 true, label %cond_true, label %cond_false
+
+cond_true:
+ br label %end
+
+cond_false:
+ %a = getelementptr { i32 }* %P, i32 0, i32 0
+ br label %end
+
+end:
+ %b = getelementptr { i32 }* %P, i32 0, i32 0
+ ret i32 0
+}