From f616ee289591dc82776ce5644c8e536578b35302 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 Dec 2009 01:47:24 +0000 Subject: [PATCH] merge two tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90691 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/GVN/rle-dominated.ll | 20 -------------------- test/Transforms/GVN/rle.ll | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 20 deletions(-) delete mode 100644 test/Transforms/GVN/rle-dominated.ll diff --git a/test/Transforms/GVN/rle-dominated.ll b/test/Transforms/GVN/rle-dominated.ll deleted file mode 100644 index e86f5929b99..00000000000 --- a/test/Transforms/GVN/rle-dominated.ll +++ /dev/null @@ -1,20 +0,0 @@ -; RUN: opt < %s -gvn -S | grep load | count 2 - -define i32 @main(i32** %p) { -block1: - %z = load i32** %p - br i1 true, label %block2, label %block3 - -block2: - %a = load i32** %p - br label %block4 - -block3: - %b = load i32** %p - br label %block4 - -block4: - %c = load i32** %p - %d = load i32* %c - ret i32 %d -} diff --git a/test/Transforms/GVN/rle.ll b/test/Transforms/GVN/rle.ll index ef34a36092a..71eb194d3a8 100644 --- a/test/Transforms/GVN/rle.ll +++ b/test/Transforms/GVN/rle.ll @@ -279,6 +279,31 @@ Cont: ; CHECK: ret i8 %A } +define i32 @chained_load(i32** %p) { +block1: + %z = load i32** %p + br i1 true, label %block2, label %block3 + +block2: + %a = load i32** %p + br label %block4 + +block3: + %b = load i32** %p + br label %block4 + +block4: + %c = load i32** %p + %d = load i32* %c + ret i32 %d + +; CHECK: @chained_load +; CHECK: %z = load i32** %p +; CHECK-NOT: load +; CHECK: %d = load i32* %z +; CHECK-NEXT: ret i32 %d +} + declare i1 @cond() readonly declare i1 @cond2() readonly