This patch teaches SCEV two implication rules:
x <u y && y >=s 0 --> x <s y, x <s y && y <s 0 --> x <u y.
And all equivalents with signs/parts swapped.
Differential D110517
[SCEV] Prove implication of predicates to their sign-flipped counterparts mkazantsev on Sep 26 2021, 10:47 PM. Authored by
Details This patch teaches SCEV two implication rules: x <u y && y >=s 0 --> x <s y, x <s y && y <s 0 --> x <u y. And all equivalents with signs/parts swapped.
Diff Detail
Unit Tests Event Timeline
|
This looks correct to me, but also rather ad-hoc -- it handles one out of multiple symmetrical patterns. For example, if we just swap both predicates (Pred == SGT and non-negative LHS) this will not trigger anymore. Or did that already get canonicalized away (in which case we should test it)?