davemgreen wrote: Oh and theoretically a `zext i1 %c` is `select %c, 1, 0`, and `sext i1 %c` is `select %c, -1, 0`, so the add/sub/or part might not be strictly necessary if they not there to control profitability. https://github.com/llvm/llvm-project/pull/115489