I've been looking at SubRange Join asserts and this function is useful to help
pinpoint problems.
I've added it in this case as an optional post RegisterCoalescer verification
check that is controlled with the -verify-live-intervals command line flag.
In reality, this check is better done just after a call to joinCopy as this will
pinpoint the precise transformation that results in illegal Segments, but I
didn't want to add an additional check for a CL flag in the core of the pass.
If you are debugging this type of problem it is easier to manually insert the
call to the check where appropriate.
The verification pass determines if there are any Segments that contain a start
or end SlotIndex that no longer exist.
These types of issue are more common for SubRanges and most of the debugging
I've done has been in this area.
Is there anything wrong with the existing -verify-coalescing switch that runs the machine verifier after coalescing, shouldn't that catch the same sort of errors?