This is the IR counterpart to 370ebc9d9a573d6 which provided a bswap narrowing fix for issue #53867.
Here we can be more general (although I'm not sure yet what would happen for illegal types in codegen - too rare to worry about?):
https://alive2.llvm.org/ce/z/3-CPfo
This assumes that we have moved the shift after the bswap as proposed in D122010.