The patch itself is simple: stop discriminating against vectors in visitAnd() and again in SimplifyDemandedBits().
Some notes for reference:
- We're not consistent about calls to SimplifyDemandedBits in the various visitXXX functions. Sometimes, we check if the RHS is a constant first. Other times (like here), we just dive in.
- I'd like to break the vector shackles in steps for the sake of risk minimization, but we could make similar simultaneous changes in other places if we think that would be better.
- I don't know what the intent of the tests in this patch was supposed to be, but since they wiggled in a positive way, I'm just going with that. :)
- In the rotate tests, note that we can see through non-splat constants. This is a result of D24253.
- My motivation for being here now is to make D31944 look better, so this is step 1 of N towards improving the vector codegen in that patch without writing any actual new code.
Looks like we're missing a SimplifyDemandedBits for ISD::ROTL/ISD::ROTR - but that's a problem for another day.