From 096f44de615482a5e698cec21fd293998aa2aa15 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 12 Feb 2009 07:00:35 +0000 Subject: [PATCH] improve naming of values in GVN, patch by Jay Foad! llvm-svn: 64363 --- llvm/lib/Transforms/Scalar/GVN.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index 9c7f9041068b..727d26555df9 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -1035,7 +1035,7 @@ bool GVN::processNonLocalLoad(LoadInst *LI, Value* v = GetValueForBlock(LI->getParent(), LI, BlockReplValues, true); LI->replaceAllUsesWith(v); - if (!isa(v)) + if (isa(v)) v->takeName(LI); if (isa(v->getType())) MD->invalidateCachedPointerInfo(v); @@ -1132,7 +1132,7 @@ bool GVN::processNonLocalLoad(LoadInst *LI, // Perform PHI construction. Value* v = GetValueForBlock(LI->getParent(), LI, BlockReplValues, true); LI->replaceAllUsesWith(v); - if (!isa(v)) + if (isa(v)) v->takeName(LI); if (isa(v->getType())) MD->invalidateCachedPointerInfo(v);