Gentoo Archives: gentoo-dev

From: Joshua Kinard <kumba@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: LTO use in the tree
Date: Sun, 27 Apr 2014 22:56:16
Message-Id: 535D8B05.2010703@gentoo.org
In Reply to: Re: [gentoo-dev] Re: LTO use in the tree by Rich Freeman
1 On 04/27/2014 07:23, Rich Freeman wrote:
2 > On Sat, Apr 26, 2014 at 10:37 PM, "C. Bergström"
3 > <cbergstrom@×××××××××.com> wrote:
4 >> #2 The only reference to anything which the compiler could impact is
5 >> "Use Boyer-Moore (and unroll its inner loop a few times)." Finding out which
6 >> flag controls that for ${CC} would have some importance. It's almost
7 >> certainly combined with -O3 and or some standalone loop related
8 >> optimization. (Nothing depending on LTO). If they were really clever or
9 >> determined - there's probably a few GCC or other pragma which could give a
10 >> hint about unrolling.
11 >
12 > So, I'll certainly agree that package-specific CFLAG tuning will
13 > always be superior to just setting some flag at the system level and
14 > walking away.
15 >
16 > And yet, in the same paragraph you mention -O3, which is tantamount to
17 > just setting a flag and walking away. That turns on 14 things you
18 > probably don't really need.
19 >
20 > I run -flto at the system level since in my experience it only causes
21 > problems with a handful of packages, and when it does provide a
22 > benefit I get it. For the most part it just means my compiles at 2AM
23 > take longer, and a bit more RAM, neither of which are a concern. If I
24 > do run into a bug, that is just an opportunity to log it and
25 > contribute (though to date I haven't been submitting -flto issues as
26 > bugs as it is still a bit new).
27
28 My curiosity, as I have not attempted LTO yet on any machine, is what are
29 the RAM requirements? Is it a hard limit, wherein the compiler simply fails
30 if there isn't enough RAM, or does it just start hitting swap real hard?
31 Those of us using older archs where the RAM is limited might have to be more
32 cautious w/ LTO. I.e., my SGI O2 maxes right now at 512MB. It can go to
33 1GB if the odd memory/PROM issue is ever worked out. But 512MB is it for
34 now, so what are my odds of successfully using LTO on that?
35
36 Especially if LTO helps to reduce the final binary size, that's less data
37 being shuffled around main memory and the CPU caches, which, although means
38 slower compile times, might hake such a machine a bit snippier. Though, I
39 dread how long GCC will take to build itself w/ LTO. The O2 already needs
40 ~18hrs for 4.8. I haven't tried 4.9 on it yet.
41
42 --
43 Joshua Kinard
44 Gentoo/MIPS
45 kumba@g.o
46 4096R/D25D95E3 2011-03-28
47
48 "The past tempts us, the present confuses us, the future frightens us. And
49 our lives slip away, moment by moment, lost in that vast, terrible in-between."
50
51 --Emperor Turhan, Centauri Republic

Replies

Subject Author
Re: [gentoo-dev] Re: LTO use in the tree Rich Freeman <rich0@g.o>