[PATCH, vec-tails 05/10] Check if loop can be masked

Jeff Law law@redhat.com
Wed Jun 22 17:20:00 GMT 2016


On 06/22/2016 09:03 AM, Ilya Enkovich wrote:
> 2016-06-16 9:26 GMT+03:00 Jeff Law <law@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?
Isn't TREE_TYPE (LOOP_VINFO_NITERS (loop_vinfo)) the type of the 
constant being used to represent the number of iterations?  That is 
independent of the type of the IV.

Though I guess your argument is that since you're building a vector of 
niters, that indeed what you want is the type of that constant, not the 
type of the IV.  That might be worth a comment in the code :-)

jeff



More information about the Gcc-patches mailing list