diff options
author | Owen Anderson <resistor@mac.com> | 2007-08-02 17:56:05 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-08-02 17:56:05 +0000 |
commit | c6a31b9ae21101644721e7d2110f0ae0fc9cbf6a (patch) | |
tree | 7cc0dca43746b27fa18cfc0e04a2506ecaef56c1 /lib/Analysis | |
parent | cd533cfd31409fd7bb9c80fb9b1cf6242f3d4bc8 (diff) | |
download | external_llvm-c6a31b9ae21101644721e7d2110f0ae0fc9cbf6a.zip external_llvm-c6a31b9ae21101644721e7d2110f0ae0fc9cbf6a.tar.gz external_llvm-c6a31b9ae21101644721e7d2110f0ae0fc9cbf6a.tar.bz2 |
Fix a bug that was causing several miscompilations on SPEC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/MemoryDependenceAnalysis.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index a280fff..47e47e5 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -111,19 +111,31 @@ void MemoryDependenceAnalysis::nonLocalHelper(Instruction* query, while (!stack.empty()) { BasicBlock* BB = stack.back(); - visited.insert(BB); - - if (resp.count(BB)) { + if (visited.count(BB)) { stack.pop_back(); continue; } if (BB != block) { + visited.insert(BB); + Instruction* localDep = getDependency(query, 0, BB); if (localDep != NonLocal) { resp.insert(std::make_pair(BB, localDep)); + stack.pop_back(); + continue; } + } else if (BB == block && stack.size() > 1) { + visited.insert(BB); + + Instruction* localDep = getDependency(query, 0, BB); + if (localDep != query) + resp.insert(std::make_pair(BB, localDep)); + + stack.pop_back(); + + continue; } bool predOnStack = false; |