I spent some time on investigating https://llvm.org/bugs/show_bug.cgi?id=21683
It looks already fixed in r223528 which switched SimpleDefinedAtom to allocate its SimpleReferences using the BumpPtrAllocator.
The only thing that does not look good for me is that SimpleDefinedAtom::sortReferences()
method uses temp SmallVector for copying into and sorting the ilist content and after that recreates the list again.
Since r247978 introduced ilist::sort I suggest the patch to use it.
Anyways I believe bug 21683 can be closed with this patch or without as fixed.
Next time, please, provide the context.
This is a specialization of ilist_sentinel_traits template, and by changing the signature you made the default method play instead of this one. It may be a luck that sorting below worked for you, but it most likely hurt the correctness.