diff options
author | Owen Anderson <resistor@mac.com> | 2007-12-08 01:37:09 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-12-08 01:37:09 +0000 |
commit | 5fc4abac3db46b6e6b3824163c0f1252c1ab0ebb (patch) | |
tree | f82d49fee10544a9970808bdb0607e63943d2eb0 /lib/Transforms | |
parent | 1713d8bcfffe1ed26920a09012dbef4587930a94 (diff) | |
download | external_llvm-5fc4abac3db46b6e6b3824163c0f1252c1ab0ebb.zip external_llvm-5fc4abac3db46b6e6b3824163c0f1252c1ab0ebb.tar.gz external_llvm-5fc4abac3db46b6e6b3824163c0f1252c1ab0ebb.tar.bz2 |
Fix several cache coherence bugs in MemDep/GVN that were found. Also add some (disabled) debugging code
to make such problems easier to diagnose in the future, written by Duncan Sands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44695 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index c3d5985..089ebb5 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -1062,6 +1062,10 @@ bool GVN::processInstruction(Instruction* I, } } + // Remove it! + MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>(); + MD.removeInstruction(I); + VN.erase(I); I->replaceAllUsesWith(repl); toErase.push_back(I); @@ -1128,11 +1132,11 @@ bool GVN::iterateOnFunction(Function &F) { // Avoid iterator invalidation ++BI; - + for (SmallVector<Instruction*, 4>::iterator I = toErase.begin(), E = toErase.end(); I != E; ++I) (*I)->eraseFromParent(); - + toErase.clear(); } } |