From 5653322e729fd2016556fd1d5e54cde20d3012d8 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 3 Jul 2007 23:51:19 +0000 Subject: 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 --- test/Transforms/GVNPRE/gep.ll | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/Transforms/GVNPRE/gep.ll (limited to 'test/Transforms') 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 +} -- cgit v1.1