I suggested this change in D23134, but it was not expressed clearly enough. Maybe reading the code is easier? :)
The existing transforms for ctlz/cttz are almost identical, and the code is obviously copy/pasted.
We just need to shift the mask over for ctlz to see if our operand gives us a known constant value.
I've also added the FIXME comment that I suggested because I think this (and several other existing transforms in this file) could be moved to InstSimplify.
Can't IsTZ be divined from the II?