[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
Mon Feb 26 10:33:06 PST 2018


mgrang added a comment.

In https://reviews.llvm.org/D39245#1019143, @RKSimon wrote:

> Wouldn't this kind of testing be better under EXPENSIVE_CHECKS instead of NDEBUG?


Complexity-wise std::shuffle is not too expensive (it's O(n) while sorting is O(n*log n). So I'm not sure if this should be under EXPENSIVE_CHECKS.
With that said, I am totally fine shoving this under EXPENSIVE_CHECKS as long as we have consensus that that's the most appropriate macro for this :) Otherwise, I guess this can remain under NDEBUG.
Thoughts?


Repository:
  rL LLVM

https://reviews.llvm.org/D39245





More information about the llvm-commits mailing list