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

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 09:12:02 PDT 2017


dexonsmith 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);
+}
----------------
Doesn't this already exist in llvm/Support/Parallel.h?


Repository:
  rL LLVM

https://reviews.llvm.org/D39245





More information about the llvm-commits mailing list