This avoids breaking possible value dependencies when sorting loads by
offset.
AMDGPU has some load instructions that write into the high or low bits
of the destination register, and have a tied input for the other input
bits. These can easily have the same base pointer, but be a swizzle so
the high address load needs to come first. This was inserting glue
forcing the opposite ordering, producing a cycle the InstrEmitter
would assert on. It may be potentially expensive to look for the
dependency between the other loads, so just skip any where this could
happen.
Fixes bug 40936 by reverting r351379, which added a hacky attempt to
fix this by adding chains in this case, which I think was just working
around broken glue before the InstrEmitter. The core of the patch is
re-implementing the fix for that problem.
There is unlikely but possible case neither is operand of another but depend through a third instruction.
Also what would happen if:
A: load i16 [base]
B: load i16 [base + 2]
C: load i8 [base + 1]
I guess normal sorting will tell A < C < B. With your change: B < A, A < C, C < B. That creates an impossible sort order.