Hi,
So I have completely rewritten the patch so that it doesn't use getWidestType and that it searches for clamped values and instructions. I have reversed the search through the loop body so that trunc instructions can be searched up from to the zext/sext nodes, noting smaller type requirements.
Cheers,
Sam
This needs doxygen comment style (///) and also a description of what a clamped type is.