This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: vectorizer cost model


* What is the best way to access target level cost information?

I'm sure you know that the loop code does this by generating RTL and
asking for the cost of it (computation_cost in tree-ssa-loop-ivopts.c).

That's a rather awkward approach but we don't have a better one.  At
some point we may need target specific costs for tree nodes, but most
likely not unless and until we move many of the RTL passes to operate
on trees.

Another possible approach is to ask target


vector_speed_up (tree vect_stmt, int VF, bool extra);

If extra = true, then this is additional statement generated by
vectorizer answer is slowdown value. This is useful while calculting
the cost of peeling etc..

If extra = false, then target calculates (or estimatees) scalar cost
based on vect_stmt (at tree ssa level, vect_stmt is sclar stmt
with vector type).

This is not as simple as I am describing here, but this approach
allows
- to handle the case where additional tree-ssa level statatements
 are inserted by vectorizer
- to handle the case where multiple target specific instructions
 are inserted by target for given single tree-ssa statement.

And this appropach makes the cost calculation issue more
manageble  because target needs to provide this info only for
vectorized statement generated by vectorizer.

-
Devang


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]