When Original IV, before widening, does not overflow, extending trip count in the loop control logic generates better code compared to truncating IV. This is because
(1) extending trip count is a loop invariant operation (see genLoopLimit where we prove trip count is loop invariant).
(2) Scalar Evolution seems to have problems understanding trunc. So removing them allows better analysis performed in Scalar Evolution. (In particular this fixes PR 28363 which is the motivation for this change).
So far I have tested this with unit-tests and test suite on pwr. I am planning to do more functional testing and also add some unit-tests. But I thought to post this here, to get some feedback.
I am not going to perform any performance test. Any degradation caused by this should be an indication of a bug elsewhere.