[llvm-commits] [llvm] r49499 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Owen Anderson resistor at mac.com
Thu Apr 10 15:13:32 PDT 2008


Author: resistor
Date: Thu Apr 10 17:13:32 2008
New Revision: 49499

URL: http://llvm.org/viewvc/llvm-project?rev=49499&view=rev
Log:
Fix for PR2190.  Memdep's non-local caching was checking dirtied blocks in the
wrong order.

Modified:
    llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=49499&r1=49498&r2=49499&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Thu Apr 10 17:13:32 2008
@@ -181,7 +181,9 @@
   
   // 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 @@
     // 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);





More information about the llvm-commits mailing list