This came up during D54876. DemandedBits and BDCE currently only support scalar integers. This patch extends them to also handle vector integer operations. In this case the demanded bits are tracked for all lanes at once (as is done for known bits and demanded bits analyses in other places).
The implementation is mostly a matter of going from isIntegerTy to isIntOrIntVectorTy and switching some ConstantInt dyn_casts to use match instead.
I think the main notable change here from an API perspective is that the getDemandedBits() method now a) requires the instruction to have an int/vec-of-int type and b) returns a "scalar size in bits" value. Previously it allowed any sized instruction and returned a "type size in bits" value. In particular, for vectors this method would have previously returned a num elements * scalar size large value (of 1s). I checked existing uses of getDemandedBits() and from what I can determine none will be invoked on anything other than integer instructions. Only BDCE passed non-integer instructions to it sometimes, but that's also adjusted as part of this patch.
I'm missing something here. Shouldn't there be two groups of demanded bits here, one group per vector lane, so that the overall demanded bits looks something like: 0x000000ff000000ff?