Some versions of libstdc++ perform self-assignment in std::shuffle. This
breaks the EXPENSIVE_CHECKS builds of TableGen due to an incorrect assertion
in libstdc++.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85828.
Fixes https://llvm.org/PR37652
This should have a comment explaining why this is needed