I think I am on the right track with frontend-only if (a + b < a)
approach (i.e: the tests that passed with my previous IR-based optimization approach still pass). I’ve ripped out the non-clang code now too
I’ve managed to get the implementation down to about 150 lines too. I’m opening a PR later this week. I’ll ping here again when it’s up.