Thanks for breaking this out to a separate patch! It makes it much easier to review.
I think this is ready to be committed with the comments below addressed. Do you have commit access, or would you like me to land it for you?
nit: there is no need to repeat the function name in the comment. This goes for the other functions too.
And instead of "This is an helper function used to..." I'd just put "Helper function that adds CaseVal to the list of cases that generate Result."
The lines from "const unsigned BitWidth" to "computeKnownBits(...)" look like leftovers from the other patch.
Please check the full icmp instruction, i.e. capture the name and what is being compared.
Please check the full icmp instruction.
I do have commit access :)
Let me know if you think it is better removing function names from the comments or not considering most of the functions have them, and after addressing this last thing I will commit it.
I put the name in the comment, because most of the other functions in the file follow that style.
As far as "This is ..." is concerned I think you are right, that piece is redundant.