From e98585eb36eff3b8c7da1cf7b044da6a05973074 Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Wed, 27 Jan 2010 22:01:02 +0000 Subject: 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 --- test/Transforms/GVN/rle-nonlocal.ll | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test/Transforms') 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 } -- cgit v1.1