I have seen some cases which SCEV's isImpliedCond returns false.
It looks `isImpliedCond' has no patterns for case which the FoundLHS or FoundRHS is AddRec and the LHS and RHS are not AddRec.
In order to handle this case, we can use below one.
If FoundLHS is AddRec and FoundPred is EQ, we can say
The min value of FoundRHS is AddRec's start value if and only if "AddRec == FoundRHS" is true.
It means we can use "FoundRHS >= AddRec's start value" for "AddRec == FoundRHS".
This changes helps IRCE pass handles cascaded sibling loops.
I find it really hard to understand this is doing based on the description. I believe the claim is that
A: Start s<= FoundRHS --> LHS s< RHS
implies
B: <Start,+,Step> == FoundRHS --> LHS s< RHS.
A sufficient condition for that to hold would be that <Start,+,Step> == FoundRHS implies Start s<= FoundRHS. I assume that was your line of reasoning.
However, this is clearly not true without further legality checks. You need to at least require that the addrec is nsw, and that the step is non-negative.