public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Architecture-dependent optimizations
@ 2004-09-30 19:57 aimen bouchhima
  2004-09-30 20:01 ` Jan Hubicka
  0 siblings, 1 reply; 3+ messages in thread
From: aimen bouchhima @ 2004-09-30 19:57 UTC (permalink / raw)
  To: gcc

Hi all,
I'm trying to compile an application for two different target architectures 
using gcc. My goal is to obtain 2 output binaries that have the same control 
flow graph structure. The problem is that , some architecture-dependent 
optimizations tend to modify the cfg structure by removing/merging basic 
blocks etc. Trying to disable such optimizations (using command line 
options), I found that this was rather a complex task cause they are 
dispersed across different  optimization passes, and some times mixed with 
other types of optimizations.
So my question is : Is there a simple and clean way to disable/enable 
architecture-dependent optimizations that affect the cfg structure in gcc?

Thanks in advance for any hint or comment

Aimen

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

* Re: Architecture-dependent optimizations
  2004-09-30 19:57 Architecture-dependent optimizations aimen bouchhima
@ 2004-09-30 20:01 ` Jan Hubicka
  2004-10-01  7:04   ` aimen bouchhima
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Hubicka @ 2004-09-30 20:01 UTC (permalink / raw)
  To: aimen bouchhima; +Cc: gcc

> Hi all,
> I'm trying to compile an application for two different target architectures 
> using gcc. My goal is to obtain 2 output binaries that have the same control 
> flow graph structure. The problem is that , some architecture-dependent 
> optimizations tend to modify the cfg structure by removing/merging basic 
> blocks etc. Trying to disable such optimizations (using command line 
> options), I found that this was rather a complex task cause they are 
> dispersed across different  optimization passes, and some times mixed with 
> other types of optimizations.
> So my question is : Is there a simple and clean way to disable/enable 
> architecture-dependent optimizations that affect the cfg structure in gcc?

No, in fact almost every optimization does affect (for instance CSE
might introduce dead instruction that might in turn result in
ellimination of basic blocks and such).
What do you need this for?  Perhaps you can get bit out of current gcov
graph dumping support...

Honza
> 
> Thanks in advance for any hint or comment
> 
> Aimen

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

* Re: Architecture-dependent optimizations
  2004-09-30 20:01 ` Jan Hubicka
@ 2004-10-01  7:04   ` aimen bouchhima
  0 siblings, 0 replies; 3+ messages in thread
From: aimen bouchhima @ 2004-10-01  7:04 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc

On Thursday 30 September 2004 19:27, Jan Hubicka wrote:
> > Hi all,
> > I'm trying to compile an application for two different target
> > architectures using gcc. My goal is to obtain 2 output binaries that have
> > the same control flow graph structure. The problem is that , some
> > architecture-dependent optimizations tend to modify the cfg structure by
> > removing/merging basic blocks etc. Trying to disable such optimizations
> > (using command line options), I found that this was rather a complex task
> > cause they are dispersed across different  optimization passes, and some
> > times mixed with other types of optimizations.
> > So my question is : Is there a simple and clean way to disable/enable
> > architecture-dependent optimizations that affect the cfg structure in
> > gcc?
>
> No, in fact almost every optimization does affect (for instance CSE
> might introduce dead instruction that might in turn result in
> ellimination of basic blocks and such).

Actually, my concern is only about those optimizations that depend on the 
target architecture AND affect the cfg . For instance, the if-conversion 
optimization may exploit some architecture-dependent features (conditional 
instructions...)  and clearly modify the underlying cfg.
The problem is that, when I tried to disable this optimization for ARM target 
(using -fno-if-conversion2 option), I noticed that not all 
conditional-instruction based optimizations were disabled (either a BUG ?? or 
probably the same optimization has been enabled from within another pass ).

I have a feeling that currently, gcc does not provide a clean separation 
between architecture-dependent and independent optimization ( may be this 
will be enabled in future using GIMBLE more efficiently)  

> What do you need this for?  Perhaps you can get bit out of current gcov
> graph dumping support...
>

I need that to run some experiments on a host target while having some 
performance estimations of another (different) target architecture ...

> Honza
>
> > Thanks in advance for any hint or comment
> >
> > Aimen

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

end of thread, other threads:[~2004-10-01  7:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-30 19:57 Architecture-dependent optimizations aimen bouchhima
2004-09-30 20:01 ` Jan Hubicka
2004-10-01  7:04   ` aimen bouchhima

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