Convert arith.cmpi to the canonical form with constants on the right side
to simplify further optimizations and open more opportunities for CSE.
Change in sccp-structured test is suspicious, I'm not sure what this test is supposed to check and why this change is needed (scf.while didn't get removed without it). Can someone help me with this?
wil -> will
Side note: The other invertPredicate should, I believe, be renamed to negatePredicate -- it's negating, not inverting. (<= would become > -- it's not just == and !=).
auto -> Pred
This can now be updated (simplified). Since you've moved the constant to the right, you only need to check for the lhs not being a constant! If the lhs is a constant, the rhs will guaranteed to be a constant at this stage given your change above.
Nit: Full stop at the end.
LGTM - please expand the commit summary to more importantly mention that this puts the ops in a canonical form in the presence of one constant. CSE and other ease in optimizing/checking follows from that.
Nit: Please punctuate appropriately. (semi-colon or full stop after side.)