Build vectors have magical truncation powers, so we have things like this:
v4i1 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1> v4i16 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>
If we don't truncate the splat node returned by getConstantSplatNode(), then we won't find truth when ZeroOrNegativeOneBooleanContent is the rule.
Note: I was hoping that ISD::isConstantSplatVector() would have worked here, but it doesn't because it has this bitsize check which I don't understand yet:
return BV->isConstantSplat(SplatVal, SplatUndef, SplatBitSize, HasUndefs) && EltVT.getSizeInBits() >= SplatBitSize;