Integer comparisons are not necessarily commutative, but you can swap the operands if you also flip the comparison - for example you can turn LessThan(const, var) into GreaterThan(var, const). We should use this property to "sort" the operands the same way we do for commutative operations. This will let us get rid of a lot of cases in the B3::lowerToAir() pattern matching.
Created attachment 335517 [details] Patch
Created attachment 335518 [details] Patch
Comment on attachment 335518 [details] Patch Thanks!
Comment on attachment 335518 [details] Patch Clearing flags on attachment: 335518 Committed r229513: <https://trac.webkit.org/changeset/229513>
All reviewed patches have been landed. Closing bug.
Oops, this patch may create an orphan value which is not allowed by B3Validate. It is also fixed in bug 183543.
<rdar://problem/38397856>