We have an overall procedure, the BitPermutation, to optimize ROTL, SHL, SRL, AND and OR. It builds up a list of collected and sorted bit groups and then ISel the entire permutation using a combination of masked rotations.
Currently BitPermutation excludes the input of a single immediate 'and', which will be transformed later through analyzing the patterns, ie. handled by the tryAs__() functions. However these patterns can only cover some specific cases, and for some other cases, BitPermutation can use fewer instructions for matching. Besides, I think it's reasonable to perform these transformations within BitPermutation since they have similar semantics with the BitPermutation.
This patch is trying to expand the BitPermutation to handle the case of single immediate 'and', therefore we can optimize more cases than the enumerated patterns.