2016-06-16 9:26 GMT+03:00 Jeff Law <l...@redhat.com>: > On 06/15/2016 05:22 AM, Richard Biener wrote: >> >> >> You look at TREE_TYPE of LOOP_VINFO_NITERS (loop_vinfo) - I don't think >> this is meaningful (if then only by accident). I think you should look at >> the >> control IV itself, possibly it's value-range, to determine the smallest >> possible >> type to use. > > Can we get an IV that's created after VRP? If so, then we have to be > prepared for the case where there's no range information on the IV. At > which point I think using type min/max of the IV is probably the right > fallback. But I do think we should be looking at range info much more > systematically. > > I can't see how TREE_TYPE of the NITERS makes sense either.
I need to build a vector {niters, ..., niters} and compare to it. Why doesn't it make sense to choose the same type for IV? I agree that choosing a smaller type may be beneficial. Shouldn't I look at nb_iterations_upper_bound then to check if NITERS can be casted to a smaller type? Thanks, Ilya > >> Finally we have a related missed optimization opportunity, namely avoiding >> peeling for gaps if we mask the last load of the group (profitability >> depends >> on the overhead of such masking of course as it would be done in the main >> vectorized loop). > > I think that's a specific instance of a more general question -- what > transformations can be avoided by masking and can we generate costs to > select between those transformations and masking. Seems like a follow-up > item rather than a requirement for this work to go forward to me. > > Jeff