[PATCH] D39245: [ADT] Shuffle containers before sorting to uncover non-deterministic behavior

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 10:39:39 PDT 2017


mgrang added inline comments.


================
Comment at: include/llvm/ADT/STLExtras.h:807-814
+template <typename ExecutionPolicy, typename IteratorTy>
+void sort(ExecutionPolicy &&Policy, IteratorTy Start, IteratorTy End) {
+#if LLVM_ENABLE_SHUFFLE_BEFORE_SORT
+  std::random_shuffle(Start, End);
+#endif
+  std::sort(Policy, Start, End);
+}
----------------
dexonsmith wrote:
> Doesn't this already exist in llvm/Support/Parallel.h?
Yea ... it apparently does. So I guess we don't need the ExecutionPolicy overloads here. Will remove them. Thanks!


Repository:
  rL LLVM

https://reviews.llvm.org/D39245





More information about the llvm-commits mailing list