diff options
author | Shih-wei Liao <sliao@google.com> | 2010-02-10 11:10:31 -0800 |
---|---|---|
committer | Shih-wei Liao <sliao@google.com> | 2010-02-10 11:10:31 -0800 |
commit | e264f62ca09a8f65c87a46d562a4d0f9ec5d457e (patch) | |
tree | 59e3d57ef656cef79afa708ae0a3daf25cd91fcf /test/Transforms/TailDup/MergeTest.ll | |
download | external_llvm-e264f62ca09a8f65c87a46d562a4d0f9ec5d457e.zip external_llvm-e264f62ca09a8f65c87a46d562a4d0f9ec5d457e.tar.gz external_llvm-e264f62ca09a8f65c87a46d562a4d0f9ec5d457e.tar.bz2 |
Check in LLVM r95781.
Diffstat (limited to 'test/Transforms/TailDup/MergeTest.ll')
-rw-r--r-- | test/Transforms/TailDup/MergeTest.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Transforms/TailDup/MergeTest.ll b/test/Transforms/TailDup/MergeTest.ll new file mode 100644 index 0000000..2224283 --- /dev/null +++ b/test/Transforms/TailDup/MergeTest.ll @@ -0,0 +1,27 @@ +; RUN: opt < %s -tailduplicate -taildup-threshold=2 -S | grep add | not grep uses=1 + +define i32 @test1(i1 %C, i32 %A, i32* %P) { +entry: + br i1 %C, label %L1, label %L2 +L1: ; preds = %entry + store i32 1, i32* %P + br label %L2 +L2: ; preds = %L1, %entry + %X = add i32 %A, 17 ; <i32> [#uses=1] + ret i32 %X +} + +define i32 @test2(i1 %C, i32 %A, i32* %P) { +entry: + br i1 %C, label %L1, label %L2 +L1: ; preds = %entry + store i32 1, i32* %P + br label %L3 +L2: ; preds = %entry + store i32 7, i32* %P + br label %L3 +L3: ; preds = %L2, %L1 + %X = add i32 %A, 17 ; <i32> [#uses=1] + ret i32 %X +} + |