The loop-carried dependency detection logic in isLoopCarriedDep relies
on the load and store using the same definition for the base register.
This misses the case of post-increment loads and stores whose base
register are different PHI initialized from the same initial value.
This commit extends the logic to accept the load and store having
different PHI base address provided that they had the same initial value
when entering the loop and are incremented by the same amount in each
loop.
Too late to comment, but I believe this if condition will mark wrong loop carried dependences.
Eg:
SU(0): %62:intregs = PHI %12:intregs, %bb.8, %85:intregs, %bb.9
SU(1): %63:intregs = L2_loadrh_io %62:intregs, 0 :: (load (s16) from %ir.arrayidx.phi)
......
......
......
SU(5): %85:intregs = S2_storerh_pi %62:intregs(tied-def 0), 8, %66:intregs :: (store (s16) into %ir.arrayidx.phi)
.......
.......
SU(10): S2_storerh_io %85:intregs, -6, %72:intregs :: (store (s16) into %ir.arrayidx.phi + 2)
SU1-SU10 will me marked as an LCD