qedawkins wrote: I can unify any duplicated logic here as well if I can be pointed to where the helpers for recognizing all ones masks are, per https://github.com/llvm/llvm-project/pull/71676#discussion_r1387560566. https://github.com/llvm/llvm-project/pull/71810