improve naming of values in GVN, patch by Jay Foad!

llvm-svn: 64363
This commit is contained in:
Chris Lattner 2009-02-12 07:00:35 +00:00
parent 5297c63565
commit 096f44de61
1 changed files with 2 additions and 2 deletions

View File

@ -1035,7 +1035,7 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
Value* v = GetValueForBlock(LI->getParent(), LI, BlockReplValues, true);
LI->replaceAllUsesWith(v);
if (!isa<GlobalValue>(v))
if (isa<PHINode>(v))
v->takeName(LI);
if (isa<PointerType>(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<GlobalValue>(v))
if (isa<PHINode>(v))
v->takeName(LI);
if (isa<PointerType>(v->getType()))
MD->invalidateCachedPointerInfo(v);