where to insert a new Simple IPA [measuring] pass from a plugin ?

Basile Starynkevitch basile@starynkevitch.net
Mon Sep 30 13:49:00 GMT 2013


I want to insert, thru a plugin, a new IPA pass which won't change any 
internal representation but will just count Gimples and functions at the IPA level.

(for what it is worth, the plugin is MELT http://gcc-melt.org/
and the IPA pass is coded in MELT; but  we can safely pretend 
all this is C++ code - which in fact it is, 
since MELT generates C++ code).

BTW, -fdump-passes show me notably:

   tree-cfg                                            :  ON
   *warn_function_return                               :  ON
   tree-ompexp                                         :  OFF
   *build_cgraph_edges                                 :  ON
   *free_lang_data                                     :  ON
   ipa-visibility                                      :  ON
   ipa-early_local_cleanups                            :  ON

I have some issues finding the right place for such a pass. I was thinking of passing 
as the reference_pass_name of some struct register_pass_info either the "ipa-visibility" string or the "visibility" string, but somehow that does not work.

It is a pity that, AFAIK, a plugin cannot insert its pass in front of 
the all_small_ipa_passes (the variable inside passes.c) - or of the 
all_regular_ipa_passes; it would be 
nice if we had some plugin API for such things. What do you think?

BTW, I also have a suggestion. We have some (relatively new) code 
(perhaps from 4.8) which suggest names in error messages when an 
identifier is misspelled.. 

Can't we use the same code (or at least same algorithm) to suggest 
a pass name when given a mispelled pass name from a plugin?

In general, I find that we are a bit lacking documentation about where 
and how a plugin can insert its own passes.


PS. See also http://gcc.gnu.org/ml/gcc/2010-11/msg00638.html
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

More information about the Gcc mailing list