As detailed on PR43513, we can simplify:
ctpop(x | -x) -> bitwidth - cttz(x, false)
Alive2: http://volta.cs.utah.edu:8080/z/caw49X
ctpop(~x & (x - 1)) -> cttz(x, false)
Alive2: http://volta.cs.utah.edu:8080/z/5zfVrx
I've tweaked the initial test cases I added at rG2d712fb75584 to increase commutativity testing, I'm happy to pre-commit these changes if you think its useful.
ConstantInt::get?