Try to reverse the constant-shrinking that happens in SimplifyDemandedBits() for 'and' masks when it results in a smaller immediate.
Other targets might want to share some of this logic by enabling this under a target hook, but I didn't see diffs for simple cases with PowerPC or AArch64, so I think they already have some specialized logic for this kind of thing.
You could create a mask from the APInt::getHighBitSet call you need to do anyway and use the DAG.MaskedValueIsZero which wraps computeKnownBits?