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]

[LTO][PATCH] Converting inline failure reason strings to symbol constants


Hi,


    This patch replaces the reason strings using in various places in
gcc.  20 dinstinct strings were identified in gcc and these were
replaced with symbolic constants of type cgraph_inline_failed_t.  We
want to use symbolic constants because LTO wants to know the reasons.
The patch has been bootstrapped on the i686-unknown-linux-gnu target.

   We can reduce the memory foot-print of cgraph edge by using only
5-bit to store the enums.   We may be able to steal 5 bits from the
loop_nest field
of the cgraph_edge structure.  This is not done in the patch as I have
no idea what the minimum size loop_nest needs to be. Currently
loop_nest is 30-bit long.  Will 25-bit be sufficient?

-Doug

2008-09-02  Doug Kwan  <dougkwan@google.com>

        * cgraphbuild.c (initialize_inline_failed): Use cgraph_inline_failed_t
        enums instead of reason strings.
        * cgraph.c (cgraph_create_edge): Same.
        (cgraph_inline_failed_string): New function.
        * cgraph.h (cgraph_inline_failed_t): New enum type.
        (cgraph_inline_failed_string): New prototype.
        (struct cgraph_edge): Change type of INLINED_FAILED from constant
        char pointer to cgraph_inline_failed_t.
        (cgraph_inline_p): Adjust prototype to use cgraph_inline_failed_t.
        (cgraph_default_inline_p): Ditto.
        * gcc/cgraphunit.c (cgraph_inline_p): Change type of parameter REASON
        to cgraph_inline_failed_t pointer.
        * lto-cgraph.c (output_edge) Write INLINE_FAILED field of an edge.
        (input_cgraph_1): Read INLINE_FAILED field of an edge.
        * ipa-inline.c (cgraph_mark_inline_edge): Use an enum instead of a
        reason string.
        (cgraph_check_inline_limits): Change type of REASON to pointer to
        cgraph_inline_failed_t.  Replace reason strings with enums.
        (cgraph_default_inline_p): Ditto.
        (cgraph_recursive_inlining_p): Ditto.
        (update_caller_keys): Change type of FAILED_REASON to
        cgraph_inline_failed_t.
        (cgraph_set_inline_failed): Change type of REASON to pointer to
        cgraph_inline_failed_t.  Call cgraph_inline_failed_string to
        convert enums to strings for text output.
        (cgraph_decide_inlining_of_small_function): Change FAILED_REASON
        to be of type cgraph_inline_failed_t.  Replace reason strings with
        enums.  Call cgraph_inline_failed_string to covert enums
        to strings for text output.
        (cgraph_decide_inlining): Replace reason strings with enums.
        (cgraph_decide_inlining_incrementally): Change type of FAILED_REASON
        to cgraph_inline_failed_t type.  Call cgraph_inline_failed_string
        for text output.
        * tree-inline.c (expand_call_inline): Change type of REASON
        to cgraph_inline_failed_t.  Replace reason strings with enums.
        Call cgraph_inline_failed_string for text output.

lto/ChangeLog:
        lto.c (lto_add_all_inlinees): Reset FAILED_REASON of edges to
        CIF_OK instead of NULL.

Attachment: patch.txt
Description: Text document


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