[PATCH] fix non-determinism issue in SLP

Daniel Reynaud dreynaud at apple.com
Fri Jan 9 10:33:53 PST 2015


> On Jan 7, 2015, at 4:59 PM, David Majnemer <david.majnemer at gmail.com> wrote:
> 
> Any reason why we can't just switch BlocksSchedules to being a MapVector?

Ah you're right, a MapVector works. Here is the amended patch:


diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp
index c8b8ff2..c2ae163 100644
--- a/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -857,7 +857,7 @@ private:
   };
 
   /// Attaches the BlockScheduling structures to basic blocks.
-  DenseMap<BasicBlock *, std::unique_ptr<BlockScheduling>> BlocksSchedules;
+  MapVector<BasicBlock *, std::unique_ptr<BlockScheduling>> BlocksSchedules;
 
   /// Performs the "real" scheduling. Done before vectorization is actually
   /// performed in a basic block.





More information about the llvm-commits mailing list