fitzgen commented on issue #5252:
Here is an example of what we used to lower these to (i.e. what happens when I comment out the rules that implement these rewrites):
--- expected +++ actual @@ -1,4 +1,6 @@ block0: - subs wzr, w0, #1118208 - cset x0, hi + movz w2, #4097 + movk w2, w2, #17, LSL #16 + subs wzr, w0, w2 + cset x0, hs ret
fitzgen commented on issue #5252:
For those following along at home: the test failure from the previous iteration of this PR was because the rules previously implemented for this "same" optimization for turning less-than-or-equal into less-than was incorrect (it would apply if the constant was on the LHS, but was firing when the constant was on the RHS).
In the future, we could try and "rotate"
const <= value
intovalue >= const
and then go through this same optimization path so that we don't need to duplicate the rules but with tiny tweaks. I opted not to do that in this PR and removed the buggy optimizations to just get this land-able.
Last updated: Dec 23 2024 at 12:05 UTC