stage2/stage3 file comparisons failures in trunk when stage2 uses -DLLVM_REVERSE_ITERATION:BOOL=ON

The -DLLVM_REVERSE_ITERATION:BOOL=ON cmake option when used in stage2 of a 3-stage bootstrap of llvm/clang/compiler-rt/libc++/polly/openmp is producing many file comparison failures between the stage2 and stage3 builds. I have opened…

https://bugs.llvm.org/show_bug.cgi?id=34956

to track this issue which doesn’t exist in the llvm 5.0.0 release. Interestingly, there doesn’t seem to be any non-deterministism in the 3-stage bootstrap on x86_64-apple-darwin17 when -DLLVM_REVERSE_ITERATION:BOOL=ON isn’t selectively used for the stage2 cmake command in the build. In that case, repeated 3-stage bootstraps don’t detect any stage2/stage3 file comparison failures. However, the use of -DLLVM_REVERSE_ITERATION:BOOL=ON in stage2 reproducibly produces stage2/stage3 file comparison failures.
Jack