public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Option processing question
@ 2020-01-11  3:47 Gary Oblock
  2020-01-11  4:49 ` Prathamesh Kulkarni
  2020-01-13 14:01 ` Richard Biener
  0 siblings, 2 replies; 6+ messages in thread
From: Gary Oblock @ 2020-01-11  3:47 UTC (permalink / raw)
  To: gcc

I'm writing an LTO optimization that requires "-flto-partition=one" How can I make
sure that this is the case? I've spent hours greping the code and the Internals Doc is
worth less than nothing for something like this. If you have an answer or even
I good idea of where to look please let me know. Note, for an normal "-fbalh" there's
a flag_blah that I could look at but for this there seems to be zip, nil, diddly squat, etc.

Many thanks,

Gary

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

* Re: Option processing question
  2020-01-11  3:47 Option processing question Gary Oblock
@ 2020-01-11  4:49 ` Prathamesh Kulkarni
  2020-01-13 14:01 ` Richard Biener
  1 sibling, 0 replies; 6+ messages in thread
From: Prathamesh Kulkarni @ 2020-01-11  4:49 UTC (permalink / raw)
  To: Gary Oblock; +Cc: gcc

On Sat, 11 Jan 2020 at 09:17, Gary Oblock <goblock@marvell.com> wrote:
>
> I'm writing an LTO optimization that requires "-flto-partition=one" How can I make
> sure that this is the case? I've spent hours greping the code and the Internals Doc is
> worth less than nothing for something like this. If you have an answer or even
> I good idea of where to look please let me know. Note, for an normal "-fbalh" there's
> a flag_blah that I could look at but for this there seems to be zip, nil, diddly squat, etc.
Hi,
Does checking flag_lto_partition == LTO_PARTITION_ONE work for your case ?

Thanks,
Prathamesh
>
> Many thanks,
>
> Gary

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

* Re: Option processing question
  2020-01-11  3:47 Option processing question Gary Oblock
  2020-01-11  4:49 ` Prathamesh Kulkarni
@ 2020-01-13 14:01 ` Richard Biener
  2020-01-13 23:32   ` [EXT] " Gary Oblock
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Biener @ 2020-01-13 14:01 UTC (permalink / raw)
  To: Gary Oblock, Jan Hubicka; +Cc: gcc

On Sat, Jan 11, 2020 at 4:47 AM Gary Oblock <goblock@marvell.com> wrote:
>
> I'm writing an LTO optimization that requires "-flto-partition=one" How can I make
> sure that this is the case? I've spent hours greping the code and the Internals Doc is
> worth less than nothing for something like this.

That's of course because you shouldn't be doing this ;)

> If you have an answer or even
> I good idea of where to look please let me know. Note, for an normal "-fbalh" there's
> a flag_blah that I could look at but for this there seems to be zip, nil, diddly squat, etc.

At LTRANS time you indeed don't know.

But there's -flto-partition=none (none, not one), that you can detect somehow
(I think in_lto_p && !flag_ltrans && !flag_wpa).

Richard.

> Many thanks,
>
> Gary

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

* Re: [EXT] Re: Option processing question
  2020-01-13 14:01 ` Richard Biener
@ 2020-01-13 23:32   ` Gary Oblock
  2020-01-14 10:29     ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Gary Oblock @ 2020-01-13 23:32 UTC (permalink / raw)
  To: Richard Biener, Jan Hubicka; +Cc: gcc

If I have an optimization set up to run in LTO (call it my_opt) and
the flags -flto-partition=one, -flto options and -fmy-opt are set
then the optimization might or might not be run depending of whether
it can all fit in one partition.

What I'm thinking is as long as it's a fatal error detectable anywhere
upstream in the compilation to not specify -fmy-opt without -flto-partition=one
then all will be well. So how do I detect it at all and where would I put the checking?

Gary
________________________________
From: Richard Biener <richard.guenther@gmail.com>
Sent: Monday, January 13, 2020 2:30 AM
To: Gary Oblock <goblock@marvell.com>; Jan Hubicka <hubicka@ucw.cz>
Cc: gcc@gcc.gnu.org <gcc@gcc.gnu.org>
Subject: [EXT] Re: Option processing question

External Email

----------------------------------------------------------------------
On Sat, Jan 11, 2020 at 4:47 AM Gary Oblock <goblock@marvell.com> wrote:
>
> I'm writing an LTO optimization that requires "-flto-partition=one" How can I make
> sure that this is the case? I've spent hours greping the code and the Internals Doc is
> worth less than nothing for something like this.

That's of course because you shouldn't be doing this ;)

> If you have an answer or even
> I good idea of where to look please let me know. Note, for an normal "-fbalh" there's
> a flag_blah that I could look at but for this there seems to be zip, nil, diddly squat, etc.

At LTRANS time you indeed don't know.

But there's -flto-partition=none (none, not one), that you can detect somehow
(I think in_lto_p && !flag_ltrans && !flag_wpa).

Richard.

> Many thanks,
>
> Gary

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

* Re: [EXT] Re: Option processing question
  2020-01-13 23:32   ` [EXT] " Gary Oblock
@ 2020-01-14 10:29     ` Richard Biener
  2020-01-14 10:34       ` Jan Hubicka
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Biener @ 2020-01-14 10:29 UTC (permalink / raw)
  To: Gary Oblock; +Cc: Jan Hubicka, gcc

On Mon, Jan 13, 2020 at 9:28 PM Gary Oblock <goblock@marvell.com> wrote:
>
> If I have an optimization set up to run in LTO (call it my_opt) and
> the flags -flto-partition=one, -flto options and -fmy-opt are set
> then the optimization might or might not be run depending of whether
> it can all fit in one partition.
>
> What I'm thinking is as long as it's a fatal error detectable anywhere
> upstream in the compilation to not specify -fmy-opt without -flto-partition=one
> then all will be well. So how do I detect it at all and where would I put the checking?

I guess you could always check the symbols used_from_other_partition
and/or in_other_partition flags?  That is, it might be perfectly possible
for some corner-cases to do the transform independently with more than one
partition if the partitioning happens to isolate things perfectly?

Richard.

> Gary
> ________________________________
> From: Richard Biener <richard.guenther@gmail.com>
> Sent: Monday, January 13, 2020 2:30 AM
> To: Gary Oblock <goblock@marvell.com>; Jan Hubicka <hubicka@ucw.cz>
> Cc: gcc@gcc.gnu.org <gcc@gcc.gnu.org>
> Subject: [EXT] Re: Option processing question
>
> External Email
>
> ----------------------------------------------------------------------
> On Sat, Jan 11, 2020 at 4:47 AM Gary Oblock <goblock@marvell.com> wrote:
> >
> > I'm writing an LTO optimization that requires "-flto-partition=one" How can I make
> > sure that this is the case? I've spent hours greping the code and the Internals Doc is
> > worth less than nothing for something like this.
>
> That's of course because you shouldn't be doing this ;)
>
> > If you have an answer or even
> > I good idea of where to look please let me know. Note, for an normal "-fbalh" there's
> > a flag_blah that I could look at but for this there seems to be zip, nil, diddly squat, etc.
>
> At LTRANS time you indeed don't know.
>
> But there's -flto-partition=none (none, not one), that you can detect somehow
> (I think in_lto_p && !flag_ltrans && !flag_wpa).
>
> Richard.
>
> > Many thanks,
> >
> > Gary

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

* Re: [EXT] Re: Option processing question
  2020-01-14 10:29     ` Richard Biener
@ 2020-01-14 10:34       ` Jan Hubicka
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Hubicka @ 2020-01-14 10:34 UTC (permalink / raw)
  To: Richard Biener; +Cc: Gary Oblock, gcc

> On Mon, Jan 13, 2020 at 9:28 PM Gary Oblock <goblock@marvell.com> wrote:
> >
> > If I have an optimization set up to run in LTO (call it my_opt) and
> > the flags -flto-partition=one, -flto options and -fmy-opt are set
> > then the optimization might or might not be run depending of whether
> > it can all fit in one partition.
> >
> > What I'm thinking is as long as it's a fatal error detectable anywhere
> > upstream in the compilation to not specify -fmy-opt without -flto-partition=one
> > then all will be well. So how do I detect it at all and where would I put the checking?
> 
> I guess you could always check the symbols used_from_other_partition
> and/or in_other_partition flags?  That is, it might be perfectly possible
> for some corner-cases to do the transform independently with more than one
> partition if the partitioning happens to isolate things perfectly?

Well, if you do optimization at ltrans you basically see symbols in
ohter partitions as external so there is not that much of practical
difference in the implementation of analysis except that it will catch
fewer transforms.

But the idea for keeping -flto-partition=none around was to make it
possible to write a prototype of IPA pass that does not nees to play
with partitioning and incrementally add WPA bits.
It seems that this strategy may work here - having a prototype that
works only w/o WHOPR but produces valid code & does something useful
seems like good first step (which is hard enough at its own).

So I would suggest to look at -flto-partition=none first and keep in
mind that eventually we will want a solution that plays well with
partitioning.

Honza
> 
> Richard.
> 
> > Gary
> > ________________________________
> > From: Richard Biener <richard.guenther@gmail.com>
> > Sent: Monday, January 13, 2020 2:30 AM
> > To: Gary Oblock <goblock@marvell.com>; Jan Hubicka <hubicka@ucw.cz>
> > Cc: gcc@gcc.gnu.org <gcc@gcc.gnu.org>
> > Subject: [EXT] Re: Option processing question
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> > On Sat, Jan 11, 2020 at 4:47 AM Gary Oblock <goblock@marvell.com> wrote:
> > >
> > > I'm writing an LTO optimization that requires "-flto-partition=one" How can I make
> > > sure that this is the case? I've spent hours greping the code and the Internals Doc is
> > > worth less than nothing for something like this.
> >
> > That's of course because you shouldn't be doing this ;)
> >
> > > If you have an answer or even
> > > I good idea of where to look please let me know. Note, for an normal "-fbalh" there's
> > > a flag_blah that I could look at but for this there seems to be zip, nil, diddly squat, etc.
> >
> > At LTRANS time you indeed don't know.
> >
> > But there's -flto-partition=none (none, not one), that you can detect somehow
> > (I think in_lto_p && !flag_ltrans && !flag_wpa).
> >
> > Richard.
> >
> > > Many thanks,
> > >
> > > Gary

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

end of thread, other threads:[~2020-01-14  9:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-11  3:47 Option processing question Gary Oblock
2020-01-11  4:49 ` Prathamesh Kulkarni
2020-01-13 14:01 ` Richard Biener
2020-01-13 23:32   ` [EXT] " Gary Oblock
2020-01-14 10:29     ` Richard Biener
2020-01-14 10:34       ` 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).