Use a more canonical way of computing a mask with N trailing 1s. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222137 91177308-0d34-0410-b5e6-96231b3b80d8
[Reassociate] Canonicalize constants to RHS operand.

Fix a thinko where the RHS was already a constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222139 91177308-0d34-0410-b5e6-96231b3b80d8