Alive2 proof: https://alive2.llvm.org/ce/z/bK93Cn I've implemented a fold in `InstCombineAndOrXor.cpp` to canonicalize `~x | (x - 1)` to `~(x & -x)` which enables the CodeGen to emit the `blsi` instruction. I've also added a test in `CodeGen/X86`. Fixes #184055 --------- Co-authored-by: Tim Gymnich <tim@gymni.ch>