This optimizes out the mask when the result of a bitmask is interpreted as an i8 or i16 value. Resolves PR50507. Differential Revision: https://reviews.llvm.org/D107103