[PATCH] D45986: [AggressiveInstCombine] convert a chain of 'or-shift' bits into masked compare

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 1 06:41:46 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D45986#1083922, @kparzysz wrote:

> This recognizes something like "bitmask-any", where the code checks if any of the bits of `V` indicated by the mask `C'` is set.  It looks like by replacing `or` with `and` you would get the corresponding "bitmask-all".  Would it be worthwhile to add it?  I don't have a use case, but the symmetry seems somewhat compelling.


Yes, that's correct. and I agree. There are actually 4 similar patterns: any-set, all-set, any-clear, all-clear. We should recognize all of them. I didn't want to go overboard on this patch though because I wasn't sure if this implementation would receive support. At the least, I will add a 'TODO' comment to this patch. Then, we can follow-up to catch the other patterns.


https://reviews.llvm.org/D45986





More information about the llvm-commits mailing list