https://github.com/dtcxzyw commented: You can set the known bits for a scalar, then create a vector splat: https://alive2.llvm.org/ce/z/oBQx2e It is clearer than and+shift+or sequence. https://github.com/llvm/llvm-project/pull/144111