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: Add "address_taken" flag into cgraph node


On Sun, May 10, 2009 at 12:12 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, May 10, 2009 at 8:12 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> Hi,
>> this patch adds code to callgraph to track if function has address taken.
>> I want to decompose current "needed" flag into individual reasons why function is
>> needed, i.e.
>> 1) function is externally visible (there is externally_visible flag for that)
>> 2) function has address taken
>> 3) function is needed for some other reason, such as used attribute
>>
>> The patch also improves oridering produced by cgraph_postorder in a way
>> that functions with addresses taken are ordered first. ?This makes it
>> possible for early optimizer to see thorough previously indirect calls
>> that folded into direct. ?It improves local-pure-const analysis
>> noticeably (about 300 new const/pures/nothrows are found in early pass
>> and no new ones are found at IPA pass that is what I hoped for given
>> that tramp3d has acyclic cgraph). ?This also makes it possible to handle
>> indirect inlining in early inliner.
>>
>> Bootstrapped/regtested x86_64-linux, will commit it shortly.
>>
>> ? ? ? ?* cgraphbuild.c (record_reference): Use cgraph_mark_address_taken_node.
>> ? ? ? ?* cgraph.c (cgraph_mark_address_taken_node): New function.
>> ? ? ? ?(dump_cgraph_node): Dump new flag.
>> ? ? ? ?* cgraph.h (struct cgraph_node): Add address_taken.
>> ? ? ? ?(cgraph_mark_address_taken_node): New function.
>> ? ? ? ?* cp/decl2.c (cxx_callgraph_analyze_expr): Use
>> ? ? ? ?cgraph_mark_address_taken.
>> ? ? ? ?* ipa.c (cgraph_postorder): Prioritize functions with address taken
>> ? ? ? ?since new direct calls can be born.
>
> This may have caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40095
>

This also caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40126


-- 
H.J.


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