public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* accessing machine specific attributes from rtx
@ 2002-11-06  4:57 Jan Beulich
  2002-11-06  5:09 ` Jan Hubicka
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2002-11-06  4:57 UTC (permalink / raw)
  To: gcc

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.

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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: accessing machine specific attributes from rtx
  2002-11-06  4:57 accessing machine specific attributes from rtx Jan Beulich
@ 2002-11-06  5:09 ` Jan Hubicka
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Hubicka @ 2002-11-06  5:09 UTC (permalink / raw)
  To: Jan Beulich; +Cc: gcc

> 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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: accessing machine specific attributes from rtx
  2002-11-06  5:55 Jan Beulich
@ 2002-11-06  7:18 ` Jan Hubicka
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Hubicka @ 2002-11-06  7:18 UTC (permalink / raw)
  To: Jan Beulich; +Cc: jh, gcc

> 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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: accessing machine specific attributes from rtx
@ 2002-11-06  5:55 Jan Beulich
  2002-11-06  7:18 ` Jan Hubicka
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2002-11-06  5:55 UTC (permalink / raw)
  To: jh; +Cc: gcc

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

>>> 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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: accessing machine specific attributes from rtx
       [not found] <sdc9285d.052@cpl-emea-mail1.cpl.novell.com>
@ 2002-11-06  5:44 ` Jan Hubicka
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Hubicka @ 2002-11-06  5:44 UTC (permalink / raw)
  To: Jan Beulich; +Cc: jh, gcc

> 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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: accessing machine specific attributes from rtx
@ 2002-11-06  5:34 Jan Beulich
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2002-11-06  5:34 UTC (permalink / raw)
  To: jh; +Cc: gcc

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).

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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-11-06 13:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06  4:57 accessing machine specific attributes from rtx Jan Beulich
2002-11-06  5:09 ` Jan Hubicka
2002-11-06  5:34 Jan Beulich
     [not found] <sdc9285d.052@cpl-emea-mail1.cpl.novell.com>
2002-11-06  5:44 ` Jan Hubicka
2002-11-06  5:55 Jan Beulich
2002-11-06  7:18 ` Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).