Fix non-determinism issue in SLP

The issue was introduced in r214638:

+  for (auto &BSIter : BlocksSchedules) {
+    scheduleBlock(BSIter.second.get());
+  }

Because BlocksSchedules is a DenseMap with BasicBlock* keys, blocks are
scheduled in non-deterministic order, resulting in unpredictable IR.

Patch by Daniel Reynaud!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225821 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Julien Lerouge 2015-01-13 19:45:52 +00:00
parent 81d2500685
commit 88e1d95d4d

View File

@ -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.