Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(11)

Issue 2793343002: Add --enable-pgo option to build clang with PGO

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 month, 3 weeks ago by matthewtff.asm
Modified:
7 hours, 18 minutes ago
Reviewers:
Reid Kleckner, Nico
CC:
chromium-reviews, eugenis+clang_chromium.org, vmpstr+watch_chromium.org, Lei Zhang, dsinclair, yunlian, glider+clang_chromium.org, ukai+watch_chromium.org, Reid Kleckner, hans, dmikurube+clang_chromium.org, inglorion
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add --enable-pgo option to build clang with PGO With this flag clang would run a multistage pgo build of clang. As a result clang being built with PGO compiles chromium about 15-20% faster for me. More details could be found in thread https://groups.google.com/a/chromium.org/forum/?utm_source=digest&utm_medium=email#!topic/chromium-dev/A3pWgkaSNrw BUG=663318

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add --enable-pgo option to build clang with PGO #

Total comments: 13

Patch Set 3 : Add clang build with PGO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+172 lines, -122 lines) Patch
M tools/clang/CMakeLists.txt View 1 2 1 chunk +9 lines, -3 lines 0 comments Download
M tools/clang/scripts/package.py View 1 2 3 chunks +12 lines, -5 lines 0 comments Download
M tools/clang/scripts/update.py View 1 2 9 chunks +139 lines, -114 lines 0 comments Download
A tools/clang/stage2.cmake View 1 2 1 chunk +12 lines, -0 lines 0 comments Download
Trybot results: Sign in to try more bots
Commit queue not available (can’t edit this change).

Messages

Total messages: 22 (3 generated)
matthewtff.asm
Nico, could you take a look at this approach, please? I'm not sure if I ...
1 month, 3 weeks ago (2017-04-04 15:22:18 UTC) #3
Reid Kleckner
Does this include automation of the training data collection process, or is that still up ...
1 month, 3 weeks ago (2017-04-04 15:37:30 UTC) #5
matthewtff.asm
On 2017/04/04 15:37:30, Reid Kleckner wrote: > Does this include automation of the training data ...
1 month, 3 weeks ago (2017-04-04 15:48:36 UTC) #6
matthewtff.asm
Gentle ping
1 month, 3 weeks ago (2017-04-07 10:23:43 UTC) #7
Nico
Sorry, I missed this. Thanks for working on this, this is cool stuff. Two high-level ...
1 month, 3 weeks ago (2017-04-07 15:58:53 UTC) #8
matthewtff.asm
https://codereview.chromium.org/2793343002/diff/20001/tools/clang/CMakeLists.txt File tools/clang/CMakeLists.txt (right): https://codereview.chromium.org/2793343002/diff/20001/tools/clang/CMakeLists.txt#newcode61 tools/clang/CMakeLists.txt:61: if (CHROMIUM_TOOLS) On 2017/04/07 15:58:53, Nico wrote: > why ...
1 month, 2 weeks ago (2017-04-11 12:14:43 UTC) #9
matthewtff.asm
On 2017/04/07 15:58:53, Nico wrote: > Sorry, I missed this. Thanks for working on this, ...
1 month, 2 weeks ago (2017-04-11 12:21:18 UTC) #10
matthewtff.asm
Back again. I've been able to build clang on windows in two stages using cmake ...
3 weeks, 5 days ago (2017-05-03 17:05:50 UTC) #11
Nico
Sounds great! On Wed, May 3, 2017 at 1:05 PM, <matthewtff@yandex-team.ru> wrote: > Back again. ...
3 weeks, 5 days ago (2017-05-03 17:34:11 UTC) #12
matthewtff.asm
Landed as r302795: https://github.com/llvm-mirror/clang/commit/c68ab69fbb44fccb8c454872d93883677b2a0cb5 Could you please notify me here as clang rolls past this ...
2 weeks, 4 days ago (2017-05-11 13:56:58 UTC) #13
Nico
https://crbug.com/714769 tracks updating clang. We've had some problems with out distributed compiler service last week ...
2 weeks, 4 days ago (2017-05-11 14:04:52 UTC) #14
Nico
Yesterday's clang roll brought us past that commit, and so far it looks like the ...
1 week, 3 days ago (2017-05-19 19:16:14 UTC) #15
matthewtff.asm
Yeah, thanks. I've subscribed to bug you gave, just wasn't sure that roll sticks given ...
1 week, 3 days ago (2017-05-19 19:19:22 UTC) #16
matthewtff.asm
So now tools/clang/stage2.cmake plays as a stage-2 cache file for both, PGO and non-PGO(on windows) ...
6 days, 23 hours ago (2017-05-23 11:27:56 UTC) #17
matthewtff.asm
On 2017/05/23 11:27:56, matthewtff.asm wrote: > So now tools/clang/stage2.cmake plays as a stage-2 cache file ...
5 days, 2 hours ago (2017-05-25 08:24:13 UTC) #18
Nico
+inglorion fyi (inglorion: maybe there's some way we could make the PGO build of clang ...
8 hours, 34 minutes ago (2017-05-30 02:34:48 UTC) #19
matthewtff.asm
On 2017/05/30 02:34:48, Nico wrote: > +inglorion fyi (inglorion: maybe there's some way we could ...
8 hours, 6 minutes ago (2017-05-30 03:02:51 UTC) #20
Nico
On 2017/05/30 03:02:51, matthewtff.asm wrote: > On 2017/05/30 02:34:48, Nico wrote: > > +inglorion fyi ...
8 hours, 3 minutes ago (2017-05-30 03:05:46 UTC) #21
matthewtff.asm
7 hours, 18 minutes ago (2017-05-30 03:50:35 UTC) #22
On 2017/05/30 03:05:46, Nico wrote:
> On 2017/05/30 03:02:51, matthewtff.asm wrote:
> > On 2017/05/30 02:34:48, Nico wrote:
> > > +inglorion fyi (inglorion: maybe there's some way we could make the PGO
> build
> > of
> > > clang work on Windows?)
> > > 
> > > matthewtff: We have this long-term goal of a deterministic build of clang,
> so
> > > that everyone who wanted could run this script locally and get the exact
> same
> > > binary as the prebuilt one. PGO makes that more or less completely
> infeasible,
> > > right?
> > 
> > Why do you say so? It makes build longer, true. But no longer than chromium
> > build, for certain.
> > I've ran this script locally lots of time while working on this CL.
> 
> Oh, I don't mean that the time becomes super long, but that the built clang
> binary is less deterministic. In a regular build, you "only" have to make sure
> that you don't put build paths in the produced binary, don't put things like
> __DATE__ in there, etc. But with PGO, if the profiles are generated locally,
> they will be machine-dependent, and then the final binary that uses the
profiles
> will then also be machine-dependent and usually not independent of the host
box.

Could you please give an example of host-dependent profile guided optimization?
According to clang docs[1] profiles from instrumented code should give
reproducible results.
But that could mean *on same host*.... Also it mentions profiles combining from
different
hosts, that also lets me think that profiles should be host-independent.

1. https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 650457f06