[PATCH] analysis of global statics and removal associated vdefs and vuses
Kenneth Zadeck
zadeck@naturalbridge.com
Sat Aug 28 03:11:00 GMT 2004
Diego Novillo wrote:
>On Fri, 2004-08-27 at 12:34, Daniel Jacobowitz wrote:
>
>
>>On Fri, Aug 27, 2004 at 12:27:54PM -0400, Diego Novillo wrote:
>>
>>
>>>On Thu, 2004-08-26 at 18:01, Kenneth Zadeck wrote:
>>>
>>>
>>>
>>>>3) use of the analysis in (2) so that the code in
>>>>gcc/tree-ssa-operands.c reduces the number of vdefs and vuses that are
>>>>inserted to account for call clobbering.
>>>>
>>>>
>>>>
>>>I've started reading the patch. So far I've noticed a slowdown in
>>>compile time that I wasn't expecting. On cc1-i-files there's a 2% slow
>>>down and on PR8361 there's about 13% (on x86-64). I've still not
>>>characterized it. More to follow later.
>>>
>>>There is a slight reduction in the number of virtual operands on
>>>cc1-i-files (2,816 fewer virtual operands or about 0.1%).
>>>
>>>As we talked earlier, one of the things that could benefit this analysis
>>>is the marking of standard library calls that do not clobber any global
>>>statics. For instance, printf does not call back into the user program,
>>>so a call to printf can't really clobber any of the variables we are
>>>interested in.
>>>
>>>
>>Printf is a bad example. There are several exceptions to your
>>statement:
>> - User-defined printf callbacks. I doubt any standard covers this,
>> but at least glibc supports it. Other libraries may also.
>> - The %n specifier clobbers the value pointed to by one of printf's
>> arguments.
>>
>>
>>
>Huh. Nice to know. Perhaps glibc might help with some attribute
>promising no nasty side effects. In any case, something for the FE
>folks to think about.
>
>
>Thanks. Diego.
>
>
The %n is not a problem. The variable passed by this mechanism would be
marked as escaping by the analysis that is there. I do not understand
what the user defined callbacks are, jeff keating did not mention these
to me when we talked about this. However, he was wearing a standards
hat while we were talking.
Also, I was looking at the tree-sra.c in order to steal some code for
the next phase of this optimization and I noticed a potiential problem
with my patch and another potiential problem with the sra code.
1) I believe that I am missing a case statement inside
scan_for_static_refs around line 2249 of cgraphunit,c it seems to me
(based on just seeing what is done in tree-sra) that I need to add a
case for RETURN_EXPR.
2) I was wondering why sra_walk_asm_expr is allowed to ignore the
ASM_CLOBBERS.
More information about the Gcc-patches
mailing list