accessing machine specific attributes from rtx

Jan Hubicka jh@suse.cz
Wed Nov 6 07:18:00 GMT 2002


> Actually I need both - the caller and the callee. And as I said, the symbol_ref for a direct call is insufficient as I'd need identical information on the target of an indirect call. More ideas? Jan

This is what callargs are used for.  Function_arg is called with dummy
VOIDmode arugment once that can return value that is later passed you as
callargs, you can use in expand_call and possibly save in insn pattern.
This is used by i386.c to save maybe_vaarg value, so you can check that.

Honza
> 
> >>> Jan Hubicka <jh@suse.cz> 06.11.02 14:44:08 >>>
> > That one I found, but this adds the attributes only to the TREE stuff, and I cannot see how I would access this information when having only rtx-es at hand (i.e. in a function called out of an expander in the .md file).
> 
> current_function_decl gives you the currently compiled function.  If you
> are asking about called function, you can not fetch it from the rtx from
> call insn I believe (without resolving back the symbol_ref that is
> dificult).  You get it when expanding the function call, so you can save
> the information shomehow.  What do you want?
> 
> Honza
> > 
> > Thanks again, Jan
> > 
> > >>> Jan Hubicka <jh@suse.cz> 06.11.02 14:09:23 >>>
> > > I would like to add a couple of optmization hint attributes to function declarations (and pointers to functions) to the IA64 targets, but I seem to have difficulty to understand how these attributes can be accessed when I have only rtx elements at hand. Specifically, the information is needed at the point where the function call is being expanded (in this case this would be in ia64_expand_call). I can see that attributes like 'pure', 'const', or 'noreturn' are being converted to notes in emit_call_1, but there does not seem to be a way to extend this scheme for a given machine. If the target were only direct function calls, then perhaps I could look up the declaration from the target function's name, but this is no alternative as it is supposed to work for indirect calls, too.
> > 
> > You are probably looking for TARGET_ATTRIBUTE_TABLE.  You may take a
> > look how it is handled on i386, that already defines some hooks for
> > optimization.
> > Let me know if you need more.
> > 
> > Honza
> > > 
> > > Thank you for any hints, Jan
> > > 
> > > 
> > > i.A. Jan Beulich
> > > Software Engineer Senior
> > > Novell Core OS Engineering
> > > 
> > > Novell, the leading provider of Net business solutions.
> > > http://www.novell.com/



More information about the Gcc mailing list