merge two tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90691 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-12-06 01:47:24 +00:00
parent c595e6ca0a
commit f616ee2895
2 changed files with 25 additions and 20 deletions

View File

@ -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
}

View File

@ -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