I noticed that passing known bits across these intrinsics isn't great at capturing the information we really know. Turning known bits of the input into known bits of a count output isn't able to convey a lot of what we really know.
This patch adds range metadata to these intrinsics based on the known bits.
Currently the patch punts if we already have range metadata present. Should we analyze the existing metadata and refine it to remove things that aren't possible based on known bits? I think its also possible that later visits of this instruction can get more known bit information if instructions are removed and we are able to look further back the input chain. I didn't see any existing code anywhere that rewrites range metadata like we would need to do here.
This doesn't look relevant to the patch - pre-commit to tidyup?