Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

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

Created:
3 years, 8 months ago by matthewtff.asm
Modified:
3 years, 6 months ago
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
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

Messages

Total messages: 24 (3 generated)
matthewtff.asm
Nico, could you take a look at this approach, please? I'm not sure if I ...
3 years, 8 months 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 ...
3 years, 8 months 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 ...
3 years, 8 months ago (2017-04-04 15:48:36 UTC) #6
matthewtff.asm
Gentle ping
3 years, 8 months 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 ...
3 years, 8 months 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 ...
3 years, 8 months 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, ...
3 years, 8 months 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 years, 7 months 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 years, 7 months 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 ...
3 years, 7 months 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 ...
3 years, 7 months 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 ...
3 years, 7 months 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 ...
3 years, 7 months 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) ...
3 years, 7 months 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 ...
3 years, 7 months 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 ...
3 years, 6 months 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 ...
3 years, 6 months 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 ...
3 years, 6 months ago (2017-05-30 03:05:46 UTC) #21
matthewtff.asm
On 2017/05/30 03:05:46, Nico wrote: > On 2017/05/30 03:02:51, matthewtff.asm wrote: > > On 2017/05/30 ...
3 years, 6 months ago (2017-05-30 03:50:35 UTC) #22
inglorion
On 2017/05/30 02:34:48, Nico wrote: > +inglorion fyi (inglorion: maybe there's some way we could ...
3 years, 6 months ago (2017-05-30 18:20:16 UTC) #23
matthewtff.asm
3 years, 6 months ago (2017-05-30 22:55:50 UTC) #24
On 2017/05/30 18:20:16, inglorion 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?)
> 
> This should already work. I added support for -fprofile-instr-generate and
> -fprofile-instr-use to clang-cl in r288230. These are used by LLVM's
> LLVM_BUILD_INSTRUMENTED and LLVM_PROFDATA_FILE to perform PGO instrumented and
> optimized builds. If this doesn't work, please let me know.

I'll give it a try tomorrow. That would be great if it works(didn't work last
time I tried)!

> > 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?
> 
> To my knowledge, the same inputs should produce the same outputs. For the PGO
> optimized build, the inputs are the sources and the profile data. Different
> profile data may result in different outputs, but I don't see how the profile
> data generated in the same way using the same source revision would lead to
> different optimized outputs. If you have concrete examples, we can figure out
> how to deal with those, but I can't think of any off the top of my head.
> 
> Note: all of this applies to instrumentation-based profiling. Perhaps you're
> thinking of sample-based profiling. I know less about that, but I'm inclined
to
> assume the sampling makes the collection of profile data non-deterministic.
> However, matthewttf is using profile-based instrumentation here, unless I'm
> mistaken.

You're totally correct, it's profile-based instrumentation.

Powered by Google App Engine
This is Rietveld 408576698