diff options
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index cd2dcf53d40..e5eef8f99e8 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -1313,6 +1313,8 @@ bool GVN::processInstruction(Instruction *I, p->replaceAllUsesWith(constVal); if (isa<PointerType>(constVal->getType())) MD->invalidateCachedPointerInfo(constVal); + VN.erase(p); + toErase.push_back(p); } else { localAvail[I->getParent()]->table.insert(std::make_pair(num, I)); |