[PATCH] D22071: Correct ordering of loads/stores.

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 12:45:19 PDT 2016


asbirlea added inline comments.

================
Comment at: lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:357-368
@@ -348,3 +356,14 @@
     }
   }
+
+  // All instructions to move should follow I. Start from I, not from begin().
+  for (auto BBI = I->getIterator(), E = I->getParent()->end(); BBI != E;
+       ++BBI) {
+    if (!is_contained(InstructionsToMove, &*BBI))
+      continue;
+    Instruction *IM = &*BBI;
+    --BBI;
+    IM->removeFromParent();
+    IM->insertBefore(I);
+  }
 }
----------------
Added a tescase now. The test fails without the above change (replacing I with IW in the dominators check)


http://reviews.llvm.org/D22071





More information about the llvm-commits mailing list