If there's a pattern like:
$xA = ADRP foo @PAGE [some killing use of reg Xb] $Xb = ADDXri $Xa, 0, @PAGEOFF
CollectLOH would create an AdrpAdd LOH that resulted in the linker optimizing this sequence into:
$xB = ADR foo [some killing use of reg $Xb]
... and therefore clobbers the live $Xb register that was used by the instruction in between.
This was discovered by a GlobalISel patch D78465 which broke up global variable accesses into two pseudos, which in some cases could be moved apart.
Will this patch prevent us from making the LOH if we have something like this?
If I understand correctly, it looks like the patch doesn't check if the use is actually between the adrp and add?