It does not have to be in Canonicalization pass (not every
optimization that replaces instructions fits into it).
I am not entirely sure that it makes perfect sense to perform such
optimization during range analysis itself though I do see at least one
reason why you would want to do that: our conditional range
propagation does not associate range information with uses, so [alpha
> 0] information becomes lost after range analysis. This can be worked
around by attaching more information to HUseListNode* during range
analysis.
Honestly speaking it's hard to speculate if some patch would be
accepted or not without actually seeing a patch.
--
Vyacheslav Egorov