This is mainly a move of simplifyShuffleOperands from DAGCombiner::visitVECTOR_SHUFFLE to create a more general purpose TargetLowering::SimplifyDemandedVectorElts implementation.
There are several features that I've begun to implement but haven't made use of yet - the KnownUndef/KnownZero element masks and support for SimplifyDemandedVectorEltsForTargetNode, if people want I can remove these for now.
Nit: getBitWidth() returns an unsigned int, leading to a sign compare warning in the assert below.