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]

Merge make_ssa_name changes from lto branch


This is the first series of patches to bring some new functionality
from the LTO branch into mainline.  The idea is to simplify the merge
process between tuples, lto and trunk.

By and large, the changes in the lto branch are orthogonal to tuples,
but the GIMPLE streamer will need to be re-implemented after tuples is
merged, so I want to minimize other spurious differences.

In the lto branch, we need to specify in which function are SSA names
created, so the call to make_ssa_name() was modified to receive an
argument of type struct function.  To make this consistent with other
interfaces that take 'struct function *' as the first argument, this
patch adds a new function make_ssa_name_fn() and converts
make_ssa_name() to a static inline function that calls
make_ssa_name_fn() with cfun.

I plan to revisit most of these interfaces that take 'struct
function*' so that we make them more consistent.  The idea is to have
pairs of 'foo_fn()', which takes struct function * and 'foo()' which
just calls foo_fn(cfun).  We already do this to a large extent, it's
just a matter of making the interface more consistent.  This should
minimize direct uses of cfun that we now have spread all over the
place.

Bootstrapped on x86_64.  I will commit after all the tests finish.
After that, I will merge into the LTO branch.


Diego.


2008-05-13  Diego Novillo  <dnovillo@google.com>
            Kenneth Zadeck  <zadeck@naturalbridge.com>

        * tree.h (init_phinodes, fini_phinodes, release_phi_node,
        phinodes_print_statistics, init_ssanames, fini_ssanames,
        make_ssa_name, duplicate_ssa_name,
        duplicate_ssa_name_ptr_info, release_ssa_name,
        release_defs, replace_ssa_name_symbol,
        ssanames_print_statistics): Move ...
        * tree-flow.h: ... here.
        * tree-ssanames.c (init_ssanames): Add arguments FN and
        SIZE.  Use FN instead of cfun.
        (make_ssa_name_fn): Rename from make_ssa_name.
        (pass_release_ssa_names): Add TODO_dump_func to finish
        flags.
        * tree-flow-inline.h (make_ssa_name): Move from
        tree-ssanames.c.  Convert to static inline.  Call
        make_ssa_name_fn.
        * omp-low.c (expand_omp_parallel):
        * tree-flow-inline.h (redirect_edge_var_map_result):
        * tree-ssa.c (init_tree_ssa): Add argument FN.  Use it
        instead of cfun.
        Update all users.

Attachment: 20080513-make_ssa_name_fn.diff.txt
Description: Text document


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