The expensive checks enabled bot on green dragon (http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/) has been failing to pass the libFuzzer :: large.test ever since the test was enabled on Darwin (i.e. REQUIRES: linux was removed). It's failing because it's timing out, and it's timing out because the compiler is too slow. I sampled the clang invocations and was shocked to see that the majority of the time was spent in calls to std::random_device inside of llvm::sort.
This patch changes the expensive checking behavior to compute a single std::random_device shuffle seed, per an invocation of clang, rather than computing it for every sort. This fixes the test failure on the bot. On my machine, this improved the performance of building compiler-rt with clang that has expensive checks enabled by 50-100x!