[PATCH] D52508: [InstCombine] Clean up after IndVarSimplify

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 9 11:57:03 PDT 2018


dmgreen added a comment.

It turns out the other case I ran into above ((S + -32) - (32 & (S + umax(31 - S, -32)))) was from do loops, not while loops. Signed will also be different to unsigned, with signed cases not having quite as small simplified forms.
These are the cases:
https://godbolt.org/z/SE-xhD
With some possible simplifications:
https://rise4fun.com/Alive/slxj

The unsigned_while case is the one fixed here. There others will need more work, with the signed ones not simplifying easily along some of those steps.

Another way to approach this might be to look at simplifying the SCEV directly, but I'm not sure if that will be any easier.


https://reviews.llvm.org/D52508





More information about the llvm-commits mailing list