[PATCH] D16611: Fix CombineToPreIndexedLoadStore O(n^2) behavior

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 21:56:30 PST 2016


majnemer added a subscriber: majnemer.

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9596
@@ -9595,1 +9595,3 @@
 
+  // Caches for hasPredecessorHelper
+  SmallPtrSet<const SDNode *, 32> Visited;
----------------
Comments should be complete sentences.

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9614
@@ -9609,4 +9613,3 @@
 
-      if (Use.getUser()->isPredecessorOf(N))
-        continue;
+      if (N->hasPredecessorHelper(Use.getUser(), Visited, Worklist)) continue;
 
----------------
Please format this with clang-format

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:6957
@@ -6955,4 +6956,3 @@
         Worklist.push_back(Op);
-      if (Op == N)
-        return true;
+      if (Op == N) Found = true;
     }
----------------
Please clang-format this.

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:6959
@@ -6958,2 +6958,3 @@
     }
+    if (Found) return true;
   }
----------------
And this.

================
Comment at: test/CodeGen/PowerPC/combine-to-pre-index-store-crash.ll:1
@@ +1,2 @@
+; RUN: llc < %s
+target datalayout = "e-m:e-i64:64-n32:64"
----------------
No FileCheck lines?


http://reviews.llvm.org/D16611





More information about the llvm-commits mailing list