This triggers with EXPENSIVE_CHECKS on for a bunch of checks (e.g. fold-sext-trunc.ll).
Unexpected Failures goes from 144 to 29.
I see that happening when there is a single value that does not have a fragment. My stdlib has:
as a first statement in sort, which with _GLIBCXX_DEBUG expands to:
_GLIBCXX_DEBUG_VERIFY(_First == _Last || !(*_First < *_First) ...
The above calls operator<. I can reproduce with:
./bin/llc < /usr/local/google/home/courbet/llvm/llvm-project/llvm/test/CodeGen/X86/fold-sext-trunc.ll -mtriple=x86_64--
Hmm is there a test that fails if you switch the condition to AFI.hasValue() > BFI.hasValue() ? I am just wondering about the sorting behavior in the absence of fragments.