GVN-hoist: invalidate MD cache (PR29144)

Without invalidating the entries in the MD cache we would try to access instructions
that were removed in previous iterations of hoisting.

Differential Revision: https://reviews.llvm.org/D23927

llvm-svn: 279907
This commit is contained in:
Sebastian Pop 2016-08-27 02:48:41 +00:00
parent acb857b831
commit 4660199a33
1 changed files with 2 additions and 0 deletions

View File

@ -846,6 +846,8 @@ private:
Repl->intersectOptionalDataWith(I);
combineKnownMetadata(Repl, I);
I->replaceAllUsesWith(Repl);
// Also invalidate the Alias Analysis cache.
MD->removeInstruction(I);
I->eraseFromParent();
}