diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-01-27 22:01:02 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-01-27 22:01:02 +0000 |
commit | e98585eb36eff3b8c7da1cf7b044da6a05973074 (patch) | |
tree | 3054abd3d9c961d2588f1a297db2f632f31804b0 /test/Transforms | |
parent | 49a43f189bc58e24988ad4ccaa0c50a544a2ccb6 (diff) | |
download | external_llvm-e98585eb36eff3b8c7da1cf7b044da6a05973074.zip external_llvm-e98585eb36eff3b8c7da1cf7b044da6a05973074.tar.gz external_llvm-e98585eb36eff3b8c7da1cf7b044da6a05973074.tar.bz2 |
Avoid creating redundant PHIs in SSAUpdater::GetValueInMiddleOfBlock.
This was already being done in SSAUpdater::GetValueAtEndOfBlock so I've
just changed SSAUpdater to check for existing PHIs in both places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94690 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/GVN/rle-nonlocal.ll | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/Transforms/GVN/rle-nonlocal.ll b/test/Transforms/GVN/rle-nonlocal.ll index 51b8986..5c73dad 100644 --- a/test/Transforms/GVN/rle-nonlocal.ll +++ b/test/Transforms/GVN/rle-nonlocal.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | grep {%DEAD = phi i32. } +; RUN: opt < %s -gvn -S | FileCheck %s define i32 @main(i32** %p) { block1: @@ -13,7 +13,12 @@ block3: br label %block4 block4: +; CHECK-NOT: %existingPHI = phi +; CHECK: %DEAD = phi + %existingPHI = phi i32* [ %a, %block2 ], [ %b, %block3 ] %DEAD = load i32** %p %c = load i32* %DEAD - ret i32 %c + %d = load i32* %existingPHI + %e = add i32 %c, %d + ret i32 %e } |