From: Sebastian Pop Date: Sat, 27 Aug 2016 02:48:41 +0000 (+0000) Subject: GVN-hoist: invalidate MD cache (PR29144) X-Git-Tag: llvmorg-4.0.0-rc1~11323 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4660199a3315513aa18fc4899d39cef17beaea0c;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp index e287ba7..4a6e934 100644 --- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp +++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp @@ -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(); }