make RLE preserve the name of the load that it replaces. This is just
[oota-llvm.git] / lib / Transforms / Scalar / GVN.cpp
index 2081811f0d17c0dd96206305dce5505835f86a6d..cb2b06b7a6d62442b1f3cbc0be165c5ee17e6a3c 100644 (file)
@@ -1034,6 +1034,7 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
     // Perform PHI construction.
     Value* v = GetValueForBlock(LI->getParent(), LI, BlockReplValues, true);
     LI->replaceAllUsesWith(v);
+    v->takeName(LI);
     if (isa<PointerType>(v->getType()))
       MD->invalidateCachedPointerInfo(v);
     toErase.push_back(LI);