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]

[PATCH, MELT] add dominance functions


Hello,

I have written a patch to allow the use of the GCC dominance functions into MELT.

This is made in order to abstract the use of calculate_dominance_info and free_dominance_info:
If the user use one of the MELT dominance related functions, it will only call calculate_dominance_info and register a call to free_dominance_info (at the end of the MELT pass) if the dominance info were not previously calculated.


The idea is :
- dominance info were already calculated (in a previous pass):
-we can use dominance info and at the end of pass, no call is made to free_dominance_info (as we expect a next pass to use dominance info and to free only when necessary).


-dominance info were not already calculated:
-We first compute dominance info, use them during the pass and free them at the end of the plugin pass (as we don't expect a next pass to use it).


Unsafe functions are only for internal use and so are not exported.

I have compiled GCC MELT with the patch and successfully test the functions.


Changelog: 2011-05-17 Pierre Vittet <piervit@pvittet.com>

    * melt/xtramelt-ana-base.melt
    (is_dominance_info_available, is_post_dominance_info_available,
    calculate_dominance_info_unsafe,
    calculate_post_dominance_info_unsafe,
    free_dominance_info, free_post_dominance_info,
    calculate_dominance_info,
    calculate_post_dominance_info, debug_dominance_info,
    debug_post_dominance_info, get_immediate_dominator_unsafe,
    get_immediate_dominator, get_immediate_post_dominator_unsafe,
    get_immediate_post_dominator, dominated_by_other_unsafe,
    dominated_by_other, post_dominated_by_other_unsafe,
    post_dominated_by_other, foreach_dominated_unsafe,
    dominated_by_bb_iterator): Add primitives, functions, iterators for
    using dominance info.


Attachment: add_dominance_function.diff
Description: Text document


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