[PATCH] D36486: [InstCombine] Don't fall back to only calling computeKnownBits if the upper bit of Add/Sub is demanded.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 09:53:35 PDT 2017


craig.topper added a comment.

I really hope there is no functional difference. I'm assuming passing an all ones demanded mask down in the case that the sign bit of the input mask is set will prevent any optimizations that can mess with the NSW/NUW property.

My desire is to move the last optimization from InstCombiner::OptAndOp to here. So if we demand only one bit from the Add, which could be the sign bit, we can turn it into an Xor. So I wanted a consistent path through the code regardless of the original demanded mask.


https://reviews.llvm.org/D36486





More information about the llvm-commits mailing list