From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-131271-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RRRQF-0002d8-UE
	for garchives@archives.gentoo.org; Fri, 18 Nov 2011 16:36:16 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 2EF0921C19A;
	Fri, 18 Nov 2011 16:36:06 +0000 (UTC)
Received: from svr-us4.tirtonadi.com (svr-us4.tirtonadi.com [69.65.43.212])
	by pigeon.gentoo.org (Postfix) with ESMTP id 7AAA721C06E
	for <gentoo-user@lists.gentoo.org>; Fri, 18 Nov 2011 16:35:07 +0000 (UTC)
Received: from mail-fx0-f53.google.com ([209.85.161.53])
	by svr-us4.tirtonadi.com with esmtpsa (TLSv1:RC4-SHA:128)
	(Exim 4.69)
	(envelope-from <pandu@poluan.info>)
	id 1RRRPB-0024Qm-7c
	for gentoo-user@lists.gentoo.org; Fri, 18 Nov 2011 23:35:09 +0700
Received: by faan15 with SMTP id n15so5406268faa.40
        for <gentoo-user@lists.gentoo.org>; Fri, 18 Nov 2011 08:35:02 -0800 (PST)
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Received: by 10.205.121.1 with SMTP id ga1mr1584297bkc.60.1321634102743; Fri,
 18 Nov 2011 08:35:02 -0800 (PST)
Received: by 10.223.74.16 with HTTP; Fri, 18 Nov 2011 08:35:02 -0800 (PST)
Received: by 10.223.74.16 with HTTP; Fri, 18 Nov 2011 08:35:02 -0800 (PST)
In-Reply-To: <CA+NOQxEreM57u56kQR4YS3LoiGbi6ZY+EAmMMEN=06gO=egipw@mail.gmail.com>
References: <4EC2B642.3010500@gmail.com>
	<j9v1kh$6bi$1@dough.gmane.org>
	<CAA2qdGXF9pfpsy7FvpPJtXvcDB0WJ+xD0SAURLLxsbm713FWpw@mail.gmail.com>
	<201111160811.17331.stephane@22decembre.eu>
	<CA+czFiDZ=2zuse5SxL9HuuG3z_v=2zKFqeV-2+=w6MyPOCpkZw@mail.gmail.com>
	<CAA2qdGUoK65s-ppsUuSyTP0wFA9CaMrm30K=z+wQdAGCtoRqXg@mail.gmail.com>
	<CA+NOQxEreM57u56kQR4YS3LoiGbi6ZY+EAmMMEN=06gO=egipw@mail.gmail.com>
Date: Fri, 18 Nov 2011 23:35:02 +0700
Message-ID: <CAA2qdGXXnDCE0_iBDBwrqJGJHei1_ZhsQN1wtREZFBmWbA_WTA@mail.gmail.com>
Subject: Re: [gentoo-user] Re: Upgrading gcc: both 4.4 and 4.5 needed?
From: Pandu Poluan <pandu@poluan.info>
To: gentoo-user@lists.gentoo.org
Content-Type: multipart/alternative; boundary=0015173ff05037924504b204eb35
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - svr-us4.tirtonadi.com
X-AntiAbuse: Original Domain - lists.gentoo.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - poluan.info
X-Archives-Salt: 381c9c55-dd88-4ebf-9592-8e315dce8add
X-Archives-Hash: ec425ef826cd0fafa780e4fecd59072e

--0015173ff05037924504b204eb35
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Nov 18, 2011 10:41 PM, "Fredric Johansson" <fredric.miscmail@gmail.com>
wrote:
>
> On Wed, Nov 16, 2011 at 2:58 PM, Pandu Poluan <pandu@poluan.info> wrote:
> >
> > On Nov 16, 2011 2:26 PM, "Michael Mol" <mikemol@gmail.com> wrote:
> >>
> >> On Wed, Nov 16, 2011 at 2:11 AM, St=C3=A9phane Guedon <
stephane@22decembre.eu>
> >> wrote:
> >> > On Wednesday 16 November 2011 02:07:12 Pandu Poluan wrote:
> >> >> And if you're adventurous, add USE "graphite", reemerge gcc, and
> >> >> reemerge
> >> >> world :)
> >> >
> >> > what does "graphite" add ?
> >>
> >> Thanks for reminding me; I meant to look it up when I got home.
> >>
> >> shortcircuit:1@serenity~
> >> Wed Nov 16 02:16 AM
> >> !501 #1 j0 ?0 $ euse -i graphite
> >> global use flags (searching: graphite)
> >> ************************************************************
> >> no matching entries found
> >>
> >> local use flags (searching: graphite)
> >> ************************************************************
> >>
> >> [snip]
> >>
> >> [-      ] graphite
> >>    sys-devel/gcc: Add support for the framework for loop optimizations
> >>    based on a polyhedral intermediate representation
> >>
> >> So, a new, experimental optimization model and framework inside your
> >> compiler. If it's specifically for optimizing on loops, I'll venture a
> >> guess it's going to be mostly effective for graphics libraries and
> >> apps. I've got some slightly riskier educated guesses on how it works
> >> and what some numeric side effects and consequences might be, but they
> >> scare me, so I think I'll leave it to someone who actually knows more
> >> about it...
> >>
> >
> > I've been using USE "graphite" since gcc-4.5.3-r1 appeared. Upstream
says
> > that graphite is stable, feature-complete, and production-ready since
4.5.3.
> >
> > To fully taste the effect of graphite, I even went the torturous route
of
> > emerging gcc + libtool + binutils (in that order) twice, followed by a
> > wholesale-rebuild of everything (emerge --emptytree), then tarballed th=
e
> > result to my own "stage3.1" tarball to spare me the *huge* amount of
time
> > required.
> >
> > I've deployed 3 systems with USE "graphite", and they *felt* snappier.
> > emerge's *felt* slower, though. (no objective tests, I know).
> >
> > I use Gentoo as a gatewall, and there I did a wholesale-rebuild one mor=
e
> > time, this time specifying CFLAGS "-march=3Dnative"... and I just
couldn't be
> > happier with the resulting performance :-)
> >
> > Rgds,
> >
>
> I might be wrong but don't you need to have the gcc's options for
> graphite enabled to actually make use of the graphite framework? (You
> might be using them but you haven't mentioned it.)
>

Yes. There are some CFLAGS incantations to add to fully utilize graphite,
else the optimizations would be marginal at best.

That said, turning on the CFLAGS flags was a *very* involved process:

1. By default, "graphite" is disabled. So you can't directly turn on the
graphite-related CFLAGS option. You must first enable USE "graphite" and
re-emerge gcc (or upgrade, if you're still using <gcc-4.5.3). This will
pull in ppl and cloog-ppl.

2. I don't know if libtool and binutils need to be remerged, but I did it
just to be safe.

3. Now that gcc has been compiled with graphite support, you can turn on
the CFLAGS flags necessary to fully utilize graphite. WARNING: some flags
recommended by upstream *might* make some programs run worse; be careful.
(I won't have access to my servers so I can't tell you which ones exactly).

4. At this point, I want gcc itself to be optimized. So, I remerged gcc and
libtool and binutils (in that order). Might be unnecessary, but I'm anal
like that :-)

5. Finally, universe-remerge (emerge --emptytree).

As you can see, steps 4 & 5 are optional. And they indeed took a
*humongous* time to complete. But I am quite satisfied with the result.
Everything felt snappier compared to older boxen that haven't been
graphite-ed :-)

Of course, YMMV.

Rgds,

--0015173ff05037924504b204eb35
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p><br>
On Nov 18, 2011 10:41 PM, &quot;Fredric Johansson&quot; &lt;<a href=3D"mail=
to:fredric.miscmail@gmail.com">fredric.miscmail@gmail.com</a>&gt; wrote:<br=
>
&gt;<br>
&gt; On Wed, Nov 16, 2011 at 2:58 PM, Pandu Poluan &lt;<a href=3D"mailto:pa=
ndu@poluan.info">pandu@poluan.info</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; On Nov 16, 2011 2:26 PM, &quot;Michael Mol&quot; &lt;<a href=3D"m=
ailto:mikemol@gmail.com">mikemol@gmail.com</a>&gt; wrote:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On Wed, Nov 16, 2011 at 2:11 AM, St=C3=A9phane Guedon &lt;<a =
href=3D"mailto:stephane@22decembre.eu">stephane@22decembre.eu</a>&gt;<br>
&gt; &gt;&gt; wrote:<br>
&gt; &gt;&gt; &gt; On Wednesday 16 November 2011 02:07:12 Pandu Poluan wrot=
e:<br>
&gt; &gt;&gt; &gt;&gt; And if you&#39;re adventurous, add USE &quot;graphit=
e&quot;, reemerge gcc, and<br>
&gt; &gt;&gt; &gt;&gt; reemerge<br>
&gt; &gt;&gt; &gt;&gt; world :)<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; what does &quot;graphite&quot; add ?<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Thanks for reminding me; I meant to look it up when I got hom=
e.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; shortcircuit:1@serenity~<br>
&gt; &gt;&gt; Wed Nov 16 02:16 AM<br>
&gt; &gt;&gt; !501 #1 j0 ?0 $ euse -i graphite<br>
&gt; &gt;&gt; global use flags (searching: graphite)<br>
&gt; &gt;&gt; ************************************************************<=
br>
&gt; &gt;&gt; no matching entries found<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; local use flags (searching: graphite)<br>
&gt; &gt;&gt; ************************************************************<=
br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; [snip]<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; [- =C2=A0 =C2=A0 =C2=A0] graphite<br>
&gt; &gt;&gt; =C2=A0 =C2=A0sys-devel/gcc: Add support for the framework for=
 loop optimizations<br>
&gt; &gt;&gt; =C2=A0 =C2=A0based on a polyhedral intermediate representatio=
n<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; So, a new, experimental optimization model and framework insi=
de your<br>
&gt; &gt;&gt; compiler. If it&#39;s specifically for optimizing on loops, I=
&#39;ll venture a<br>
&gt; &gt;&gt; guess it&#39;s going to be mostly effective for graphics libr=
aries and<br>
&gt; &gt;&gt; apps. I&#39;ve got some slightly riskier educated guesses on =
how it works<br>
&gt; &gt;&gt; and what some numeric side effects and consequences might be,=
 but they<br>
&gt; &gt;&gt; scare me, so I think I&#39;ll leave it to someone who actuall=
y knows more<br>
&gt; &gt;&gt; about it...<br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt; I&#39;ve been using USE &quot;graphite&quot; since gcc-4.5.3-r1 a=
ppeared. Upstream says<br>
&gt; &gt; that graphite is stable, feature-complete, and production-ready s=
ince 4.5.3.<br>
&gt; &gt;<br>
&gt; &gt; To fully taste the effect of graphite, I even went the torturous =
route of<br>
&gt; &gt; emerging gcc + libtool + binutils (in that order) twice, followed=
 by a<br>
&gt; &gt; wholesale-rebuild of everything (emerge --emptytree), then tarbal=
led the<br>
&gt; &gt; result to my own &quot;stage3.1&quot; tarball to spare me the *hu=
ge* amount of time<br>
&gt; &gt; required.<br>
&gt; &gt;<br>
&gt; &gt; I&#39;ve deployed 3 systems with USE &quot;graphite&quot;, and th=
ey *felt* snappier.<br>
&gt; &gt; emerge&#39;s *felt* slower, though. (no objective tests, I know).=
<br>
&gt; &gt;<br>
&gt; &gt; I use Gentoo as a gatewall, and there I did a wholesale-rebuild o=
ne more<br>
&gt; &gt; time, this time specifying CFLAGS &quot;-march=3Dnative&quot;... =
and I just couldn&#39;t be<br>
&gt; &gt; happier with the resulting performance :-)<br>
&gt; &gt;<br>
&gt; &gt; Rgds,<br>
&gt; &gt;<br>
&gt;<br>
&gt; I might be wrong but don&#39;t you need to have the gcc&#39;s options =
for<br>
&gt; graphite enabled to actually make use of the graphite framework? (You<=
br>
&gt; might be using them but you haven&#39;t mentioned it.)<br>
&gt;</p>
<p>Yes. There are some CFLAGS incantations to add to fully utilize graphite=
, else the optimizations would be marginal at best.</p>
<p>That said, turning on the CFLAGS flags was a *very* involved process:</p=
>
<p>1. By default, &quot;graphite&quot; is disabled. So you can&#39;t direct=
ly turn on the graphite-related CFLAGS option. You must first enable USE &q=
uot;graphite&quot; and re-emerge gcc (or upgrade, if you&#39;re still using=
 &lt;gcc-4.5.3). This will pull in ppl and cloog-ppl.</p>

<p>2. I don&#39;t know if libtool and binutils need to be remerged, but I d=
id it just to be safe.</p>
<p>3. Now that gcc has been compiled with graphite support, you can turn on=
 the CFLAGS flags necessary to fully utilize graphite. WARNING: some flags =
recommended by upstream *might* make some programs run worse; be careful. (=
I won&#39;t have access to my servers so I can&#39;t tell you which ones ex=
actly).</p>

<p>4. At this point, I want gcc itself to be optimized. So, I remerged gcc =
and libtool and binutils (in that order). Might be unnecessary, but I&#39;m=
 anal like that :-) </p>
<p>5. Finally, universe-remerge (emerge --emptytree).</p>
<p>As you can see, steps 4 &amp; 5 are optional. And they indeed took a *hu=
mongous* time to complete. But I am quite satisfied with the result. Everyt=
hing felt snappier compared to older boxen that haven&#39;t been graphite-e=
d :-) </p>

<p>Of course, YMMV.</p>
<p>Rgds,<br>
</p>

--0015173ff05037924504b204eb35--