Be sure to remove values from the value numbering table after we delete them.
[oota-llvm.git] / lib / Transforms / Scalar / GVN.cpp
index c9eb24743280528e4fb6f18c383c8a315d5ec35f..f8522694286957747cd5a816915211430003fd30 100644 (file)
@@ -1234,6 +1234,7 @@ bool GVN::performPRE(Function& F) {
               UUI->second = Phi;
       
       BI->replaceAllUsesWith(Phi);
+      VN.erase(BI);
       
       Instruction* erase = BI;
       BI++;