diff options
author | Owen Anderson <resistor@mac.com> | 2008-04-10 22:13:32 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-04-10 22:13:32 +0000 |
commit | f062f10231590919d9d78ee2f7d3cb29f1c09e66 (patch) | |
tree | 775cf8a52c99b0e0eda35e689ec79e77add85c18 /lib/Analysis/MemoryDependenceAnalysis.cpp | |
parent | 3bd659ba20c235caabb0df6f93888d898197afb0 (diff) | |
download | external_llvm-f062f10231590919d9d78ee2f7d3cb29f1c09e66.zip external_llvm-f062f10231590919d9d78ee2f7d3cb29f1c09e66.tar.gz external_llvm-f062f10231590919d9d78ee2f7d3cb29f1c09e66.tar.bz2 |
Fix for PR2190. Memdep's non-local caching was checking dirtied blocks in the
wrong order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r-- | lib/Analysis/MemoryDependenceAnalysis.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index e881f79..00e857d 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -181,7 +181,9 @@ void MemoryDependenceAnalysis::nonLocalHelper(Instruction* query, // Current stack of the DFS SmallVector<BasicBlock*, 4> stack; - stack.push_back(block); + for (pred_iterator PI = pred_begin(block), PE = pred_end(block); + PI != PE; ++PI) + stack.push_back(*PI); // Do a basic DFS while (!stack.empty()) { @@ -208,7 +210,7 @@ void MemoryDependenceAnalysis::nonLocalHelper(Instruction* query, // If we re-encounter the starting block, we still need to search it // because there might be a dependency in the starting block AFTER // the position of the query. This is necessary to get loops right. - } else if (BB == block && stack.size() > 1) { + } else if (BB == block) { visited.insert(BB); Instruction* localDep = getDependency(query, 0, BB); |