diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-02-16 20:48:55 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-02-16 20:48:55 +0000 |
commit | 713bc585ef5f60129c950f69392cefa85b9aaac1 (patch) | |
tree | 9bc26a8a60922766802f065d97a5f812d902a424 /test/Transforms/GVN/pre-load.ll | |
parent | 39be8fcfdcad1b01997b22739a889d7c819600d5 (diff) | |
download | external_llvm-713bc585ef5f60129c950f69392cefa85b9aaac1.zip external_llvm-713bc585ef5f60129c950f69392cefa85b9aaac1.tar.gz external_llvm-713bc585ef5f60129c950f69392cefa85b9aaac1.tar.bz2 |
Testcase for critical edge splitting with load PRE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVN/pre-load.ll')
-rw-r--r-- | test/Transforms/GVN/pre-load.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Transforms/GVN/pre-load.ll b/test/Transforms/GVN/pre-load.ll index 7047d4e..d40a467 100644 --- a/test/Transforms/GVN/pre-load.ll +++ b/test/Transforms/GVN/pre-load.ll @@ -362,3 +362,30 @@ bb: return: ret void } + +; Test critical edge splitting. +define i32 @test11(i32* %p, i1 %C, i32 %N) { +; CHECK: @test11 +block1: + br i1 %C, label %block2, label %block3 + +block2: + %cond = icmp sgt i32 %N, 1 + br i1 %cond, label %block4, label %block5 +; CHECK: load i32* %p +; CHECK-NEXT: br label %block4 + +block3: + store i32 0, i32* %p + br label %block4 + +block4: + %PRE = load i32* %p + br label %block5 + +block5: + %ret = phi i32 [ 0, %block2 ], [ %PRE, %block4 ] + ret i32 %ret +; CHECK: block4: +; CHECK-NEXT: phi i32 +} |