Issue 10470 in v8: Tracking bug: profile-guided optimization of builtins

65 views
Skip to first unread message

seth.bre… via monorail

unread,
Apr 28, 2020, 12:00:14 PM4/28/20
to v8-re...@googlegroups.com
Status: Assigned
Owner: seth.bre...@microsoft.com
Priority: 3
Type: FeatureRequest

New issue 10470 by seth.bre...@microsoft.com: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470

Design doc: https://docs.google.com/document/d/1szInbXZfaErWW70d30hJsOLL0Es-l5_g8d2rXm1ZBqI/edit#heading=h.tlaem7damy6a

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

bugdroid via monorail

unread,
May 21, 2020, 12:33:44 PM5/21/20
to v8-re...@googlegroups.com

Comment #1 on issue 10470 by bugdroid: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c1

The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8.git/+/18c73676c1db2868efa5a927046fa9caa0a70c6d

commit 18c73676c1db2868efa5a927046fa9caa0a70c6d
Author: Seth Brenith <seth.b...@microsoft.com>
Date: Thu May 21 16:31:52 2020

[diagnostics] Support --turbo-profiling for builtins

Currently, if d8 is run with the --turbo-profiling flag, it prints info
about every TurboFan-compiled function. This info includes the number of
times that each basic block in the function was run. It also includes
text representations of the function's schedule and code, so that the
person reading the output can associate counters with blocks of code.

The data about each function is currently stored in a
BasicBlockProfiler::Data instance, which is attached to a list owned by
the singleton BasicBlockProfiler. Each Data contains an
std::vector<uint32_t> which represents how many times each block in the
function has executed. The generated code for each block uses a raw
pointer into the storage of that vector to implement incrementing the
counter.

With this change, if you compile with v8_enable_builtins_profiling and
then run with --turbo-profiling, d8 will print that same info about
builtins too.

In order to generate code that can survive being serialized to a
snapshot and reloaded, this change uses counters in the JS heap instead
of a std::vector outside the JS heap. The steps for instrumentation are
as follows:

1. Between scheduling and instruction selection, add code to increment
the counter for each block. The counters array doesn't yet exist at
this point, and allocation is disallowed, so at this point the code
refers to a special marker value.
2. During finalization of the code, allocate a BasicBlockProfilingData
object on the JS heap containing data equivalent to what is stored in
BasicBlockProfiler::Data. This includes a ByteArray that is big
enough to store the counters for each block.
3. Patch the reference in the BuiltinsConstantsTableBuilder so that
instead of referring to the marker object, it now refers to this
ByteArray. Also add the BasicBlockProfilingData object to a list that
is attached to the heap roots so it can be easily accessed for
printing.

Because these steps include modifying the BuiltinsConstantsTableBuilder,
this procedure is only applicable to builtins. Runtime-generated code
still uses raw pointers into std::vector instances. In order to keep
divergence between these code paths to a minimum, most work is done
referring to instances of BasicBlockProfiler::Data (the C++ class), and
functions are provided to copy back and forth between that type and
BasicBlockProfilingData (the JS heap object).

This change is intended only to make --turbo-profiling work consistently
on more kinds of functions, but with some further work, this data could
form the basis for:
- code coverage info for fuzzers, and/or
- hot-path info for profile-guided optimization.

Bug: v8:10470, v8:9119
Change-Id: Ib556a5bc3abe67cdaa2e3ee62702a2a08b11cb61
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2159738
Commit-Queue: Seth Brenith <seth.b...@microsoft.com>
Reviewed-by: Ulan Degenbaev <ul...@chromium.org>
Reviewed-by: Jakob Gruber <jgr...@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67944}

[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/BUILD.gn
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/builtins/constants-table-builder.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/builtins/constants-table-builder.h
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/codegen/optimized-compilation-info.h
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/compiler/backend/code-generator.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/compiler/basic-block-instrumentor.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/compiler/basic-block-instrumentor.h
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/compiler/pipeline.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/d8/d8.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/diagnostics/basic-block-profiler.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/diagnostics/basic-block-profiler.h
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/diagnostics/objects-debug.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/heap/factory.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/heap/factory.h
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/heap/heap.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/heap/heap.h
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/heap/setup-heap-internal.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/objects/oddball.h
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/objects/shared-function-info.tq
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/src/roots/roots.h
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/test/cctest/compiler/test-basic-block-profiler.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/test/cctest/test-roots.cc
[modify] https://crrev.com/18c73676c1db2868efa5a927046fa9caa0a70c6d/tools/v8heapconst.py

bugdroid via monorail

unread,
Jun 2, 2020, 11:19:24 AM6/2/20
to v8-re...@googlegroups.com

Comment #2 on issue 10470 by bugdroid: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c2


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8.git/+/7ce4b196ce0d55f9c7c49417c5ecf633f0fcde74

commit 7ce4b196ce0d55f9c7c49417c5ecf633f0fcde74
Author: Seth Brenith <seth.b...@microsoft.com>
Date: Tue Jun 02 15:18:52 2020

[diagnostics] Make basic block profiling more configurable

This change adds more granular control to the behavior that was
previously controlled by the single flag --turbo-profiling. With this
change, it becomes possible to:
- output information only about builtins, ignoring functions compiled at
runtime
- skip the very slow process of writing the schedule and disassembly for
all builtins, if you only want the block counts and don't need verbose
output

This change also moves the output step from Shell::OnExit to
Isolate::DumpAndResetStats so that it's more consistent with other
features and works in hosts other than d8.


Bug: v8:10470, v8:9119
Change-Id: I19b1caca3ff27a2e4a6fdc7ad2f8174f8d678b3a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2216717
Reviewed-by: Ross McIlroy <rmci...@chromium.org>
Reviewed-by: Jakob Gruber <jgr...@chromium.org>
Commit-Queue: Seth Brenith <seth.b...@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#68104}

[modify] https://crrev.com/7ce4b196ce0d55f9c7c49417c5ecf633f0fcde74/BUILD.gn
[modify] https://crrev.com/7ce4b196ce0d55f9c7c49417c5ecf633f0fcde74/src/compiler/basic-block-instrumentor.cc
[modify] https://crrev.com/7ce4b196ce0d55f9c7c49417c5ecf633f0fcde74/src/d8/d8.cc
[modify] https://crrev.com/7ce4b196ce0d55f9c7c49417c5ecf633f0fcde74/src/diagnostics/basic-block-profiler.cc
[modify] https://crrev.com/7ce4b196ce0d55f9c7c49417c5ecf633f0fcde74/src/diagnostics/basic-block-profiler.h
[modify] https://crrev.com/7ce4b196ce0d55f9c7c49417c5ecf633f0fcde74/src/execution/isolate.cc
[modify] https://crrev.com/7ce4b196ce0d55f9c7c49417c5ecf633f0fcde74/src/flags/flag-definitions.h
[modify] https://crrev.com/7ce4b196ce0d55f9c7c49417c5ecf633f0fcde74/src/heap/factory.cc

bugdroid via monorail

unread,
Jul 22, 2020, 1:15:22 PM7/22/20
to v8-re...@googlegroups.com

Comment #3 on issue 10470 by bugdroid: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c3


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8.git/+/922983dfd3686fb39a6dad6124d8e58f21e327fa

commit 922983dfd3686fb39a6dad6124d8e58f21e327fa
Author: Seth Brenith <seth.b...@microsoft.com>
Date: Wed Jul 22 17:12:23 2020

Profile-guided optimization of builtins

Design doc:
https://docs.google.com/document/d/1szInbXZfaErWW70d30hJsOLL0Es-l5_g8d2rXm1ZBqI/edit?usp=sharing

V8 can already collect data about how many times each basic block in the
builtins is run. This change enables using that data for profile-guided
optimization. New comments in BUILD.gn describe how to use this feature.

A few implementation details worth mentioning, which aren't covered in
the design doc:

- BasicBlockProfilerData currently contains an array of RPO numbers.
However, this array is always just [0, 1, 2, 3, ...], so this change
removes that array. A new DCHECK in BasicBlockInstrumentor::Instrument
ensures that the removal is valid.

- RPO numbers, while useful for printing data that matches with the
stringified schedule, are not useful for matching profiling data with
blocks that haven't been scheduled yet. This change adds a new array
of block IDs in BasicBlockProfilerData, so that block counters can be
used for PGO.

- Basic block counters need to be written to a file so that they can be
provided to a subsequent run of mksnapshot, but the design doc doesn't
specify the transfer format or what file is used. In this change, I
propose using the existing v8.log file for that purpose. Block count
records look like this:

block,TestLessThanHandler,37,29405

This line indicates that block ID 37 in TestLessThanHandler was run
29405 times. If multiple lines refer to the same block, the reader
adds them all together. I like this format because it's easy to use:
- V8 already has robust logic for creating the log file, naming it to
avoid conflicts in multi-process situations, etc.
- Line order doesn't matter, and interleaved writes from various
logging sources are fine, given that V8 writes each line atomically.
- Combining multiple sources of profiling data is as simple as
concatenating their v8.log files together.

- It is a good idea to avoid making any changes based on profiling data
if the function being compiled doesn't match the one that was
profiled, since it is common to use profiling data downloaded from a
central lab which is updated only periodically. To check whether a
function matches, I propose using a hash of the Graph state right
before scheduling. This might be stricter than necessary, as some
changes to the function might be small enough that the profile data is
still relevant, but I'd rather err on the side of not making incorrect
changes. This hash is also written to the v8.log file, in a line that
looks like this:

builtin_hash,LdaZeroHandler,3387822046

Bug: v8:10470
Change-Id: I429e5ce5efa94e01e7489deb3996012cf860cf13
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2220765
Commit-Queue: Seth Brenith <seth.b...@microsoft.com>
Reviewed-by: Ross McIlroy <rmci...@chromium.org>
Reviewed-by: Tobias Tebbi <te...@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69008}

[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/BUILD.gn
[add] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/builtins/profile-data-reader.cc
[add] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/builtins/profile-data-reader.h
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/builtins/setup-builtins-internal.cc
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/compiler/basic-block-instrumentor.cc
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/compiler/code-assembler.cc
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/compiler/code-assembler.h
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/compiler/pipeline.cc
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/compiler/pipeline.h
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/compiler/scheduler.cc
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/compiler/scheduler.h
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/diagnostics/basic-block-profiler.cc
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/diagnostics/basic-block-profiler.h
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/flags/flag-definitions.h
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/interpreter/interpreter-generator.cc
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/logging/log-utils.h
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/logging/log.cc
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/logging/log.h
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/src/objects/shared-function-info.tq
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/test/cctest/compiler/code-assembler-tester.h
[modify] https://crrev.com/922983dfd3686fb39a6dad6124d8e58f21e327fa/test/unittests/compiler/scheduler-unittest.cc

bugdroid via monorail

unread,
Sep 29, 2020, 9:50:49 AM9/29/20
to v8-re...@googlegroups.com

Comment #4 on issue 10470 by bugdroid: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c4


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8.git/+/a149be889e0cd29b3029ff64a4b8e00cf8acc124

commit a149be889e0cd29b3029ff64a4b8e00cf8acc124
Author: Seth Brenith <seth.b...@microsoft.com>
Date: Tue Sep 29 13:50:21 2020

Fix handling of v8_builtins_profiling_log_file gn argument

There were two problems:
1. v8_builtins_profiling_log_file was not declared in "sources" or
"inputs", so Ninja wouldn't re-run mksnapshot if it changed.
2. v8_builtins_profiling_log_file was passed directly to mksnapshot
without rebasing the path, which makes it awkward and inconsistent
with how most other gn arguments work.

Bug: v8:10470
Change-Id: Id8edba325b867e8d9561d3c76f28e121641d0dd4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2434103
Reviewed-by: Tobias Tebbi <te...@chromium.org>
Commit-Queue: Seth Brenith <seth.b...@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#70199}

[modify] https://crrev.com/a149be889e0cd29b3029ff64a4b8e00cf8acc124/BUILD.gn

seth.… via monorail

unread,
Nov 16, 2020, 1:46:52 PM11/16/20
to v8-re...@googlegroups.com

Comment #5 on issue 10470 by seth....@microsoft.com: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c5

I'm still not thrilled by the results. Of course PGO will make some things better and others worse, but I hope that with some additional tweaks we can get more improvements and fewer regressions. A few things I've tried locally, most of which showed some promise:

- When choosing to mark a block as deferred, base the decision not on the weight of the block immediately after the branch but on the heaviest block that would become deferred as a result of the decision, which might be in a subsequent loop or after a merge from another block that was already deferred.
- Avoid deferring loop exits: of course they're less likely than staying in the loop, but that doesn't mean deferring the rest of the function is a smart idea.
- If a branch has a manual branch hint and the profiling data shows the branch to be roughly equal or weighted in the wrong direction, clear the branch hint.
- When RPO-izing the blocks in Scheduler, visit successors in order of increasing profile count. The idea here is to lightly prefer likely blocks by putting them earlier in the schedule, without damaging the unlikely blocks as much as a deferred marking would. The register allocator naturally prefers earlier blocks due to its heuristics that spill the value with the furthest-away use in linear instruction order.
- In the register allocator, when choosing the state at the beginning of a merge block, use the profile count as a tiebreaker. Surprisingly, this change did more harm than good in my initial test.

There's also a bug in Graph hash computation: sometimes, if you collect data for C++ PGO and V8 builtins PGO at the same time, then the next phase of V8 compilation may reject some functions. This happens because the C++ linker doesn't deduplicate identical functions when building with instrumentation enabled, which slightly changes the shape of the Graph if a V8 builtin calls multiple runtime functions which are distinct but identical. To fix, all ExternalConstant nodes can share the same traversal number, and we can avoid adding any of them to the rolling hash.

bugdroid via monorail

unread,
Nov 19, 2020, 2:44:33 PM11/19/20
to v8-re...@googlegroups.com

Comment #6 on issue 10470 by bugdroid: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c6


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8.git/+/ab52d52527345871c898700728133f64faf6532f

commit ab52d52527345871c898700728133f64faf6532f
Author: Seth Brenith <seth.b...@microsoft.com>
Date: Thu Nov 19 19:43:37 2020

Avoid overflow when profiling builtins

The basic block instrumentation currently uses 32-bit integers, which
could overflow during a long profiling session. I considered upgrading
them to 64-bit integers, but generating the correct instrumentation code
for various architectures would be rather non-trivial. Instead, this
change uses 64-bit floating-point values, which are simple and also have
the nice behavior that they saturate rather than overflowing.

Bug: v8:10470
Change-Id: I60f7456cb750091809803c03a85dd348dc614b58
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2545573

Reviewed-by: Tobias Tebbi <te...@chromium.org>
Commit-Queue: Seth Brenith <seth.b...@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#71297}

[modify] https://crrev.com/ab52d52527345871c898700728133f64faf6532f/src/builtins/profile-data-reader.cc
[modify] https://crrev.com/ab52d52527345871c898700728133f64faf6532f/src/builtins/profile-data-reader.h
[modify] https://crrev.com/ab52d52527345871c898700728133f64faf6532f/src/compiler/basic-block-instrumentor.cc
[modify] https://crrev.com/ab52d52527345871c898700728133f64faf6532f/src/compiler/scheduler.cc
[modify] https://crrev.com/ab52d52527345871c898700728133f64faf6532f/src/diagnostics/basic-block-profiler.cc
[modify] https://crrev.com/ab52d52527345871c898700728133f64faf6532f/src/diagnostics/basic-block-profiler.h
[modify] https://crrev.com/ab52d52527345871c898700728133f64faf6532f/src/logging/log.cc
[modify] https://crrev.com/ab52d52527345871c898700728133f64faf6532f/src/logging/log.h
[modify] https://crrev.com/ab52d52527345871c898700728133f64faf6532f/src/objects/shared-function-info.tq
[modify] https://crrev.com/ab52d52527345871c898700728133f64faf6532f/test/cctest/compiler/test-basic-block-profiler.cc

Git Watcher via monorail

unread,
Apr 29, 2022, 11:22:20 AM4/29/22
to v8-re...@googlegroups.com

Comment #7 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c7


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/0e127bcef7cb0e392c4cae996f9ff8b11f09b824

commit 0e127bcef7cb0e392c4cae996f9ff8b11f09b824
Author: George Wort <georg...@arm.com>
Date: Fri Apr 29 14:08:41 2022

Make profile-guided optimization of builtins more configurable

Introduce get_hints.py and combine_hints.py in order to make
the interpretation of basic block counts into hints more
configurable and explicit, as well as allowing more accurate
and consistent methods of combining multiple profiles.

get_hints.py allows for the minimum count and threshold ratio
values to be easily altered for different profiles, while
combine_hints.py allows the hints produced from different
benchmarks and threshold values to be easily and sensibly
combined.

Simply summing together basic block counts from different
benchmarks could previously lead to a longer running benchmark
overshadowing multiple shorter benchmarks with conflicting
hints.

Allowing alteration of the current threshold values gives a
doubling of performance, while the new method of combining
distinct profiles can double the performance improvement of the
secondary benchmark while losing as little as 4% of the
improvement gained in the primary benchmark.

Design doc: https://docs.google.com/document/d/1OhwZnIZom47IX0lyceyt-S9i8AApDB0UqJdvQD6NuKQ/edit?usp=sharing

Bug: v8:10470
Change-Id: I1c09d1eabfdda5ed6794592e2c13ff8b461be361
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3545181
Reviewed-by: Tobias Tebbi <te...@chromium.org>
Commit-Queue: George Wort <georg...@arm.com>
Cr-Commit-Position: refs/heads/main@{#80282}

[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/logging/log.h
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/compiler/scheduler.cc
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/compiler/common-operator.h
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/diagnostics/basic-block-profiler.cc
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/common/globals.h
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/diagnostics/basic-block-profiler.h
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/compiler/wasm-compiler.h
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/builtins/profile-data-reader.cc
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/compiler/basic-block-instrumentor.cc
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/compiler/common-operator.cc
[add] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/tools/combine_hints.py
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/builtins/profile-data-reader.h
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/BUILD.gn
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/objects/shared-function-info.tq
[modify] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/src/logging/log.cc
[add] https://crrev.com/0e127bcef7cb0e392c4cae996f9ff8b11f09b824/tools/get_hints.py

Git Watcher via monorail

unread,
Jun 22, 2022, 10:31:06 AM6/22/22
to v8-re...@googlegroups.com

Comment #8 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c8


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/f914df6574f00021ca1d36503a1d79427359b325

commit f914df6574f00021ca1d36503a1d79427359b325
Author: Igor Sheludko <ish...@chromium.org>
Date: Tue Jun 21 16:16:14 2022

[builtins-pgo] Minor fixes in the profile reader

This CL also makes the PGO-related scripts executable.

Bug: v8:10470
Change-Id: Iedf81464ff591e641aae4f1f0aa37312875f2637
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3716482
Reviewed-by: Tobias Tebbi <te...@chromium.org>
Auto-Submit: Igor Sheludko <ish...@chromium.org>
Commit-Queue: Tobias Tebbi <te...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81305}

[modify] https://crrev.com/f914df6574f00021ca1d36503a1d79427359b325/tools/combine_hints.py
[modify] https://crrev.com/f914df6574f00021ca1d36503a1d79427359b325/src/builtins/profile-data-reader.cc
[modify] https://crrev.com/f914df6574f00021ca1d36503a1d79427359b325/tools/get_hints.py

Git Watcher via monorail

unread,
Jul 25, 2022, 12:13:06 PM7/25/22
to v8-re...@googlegroups.com

Comment #9 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c9


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/3e6ad9f2b602083b39631981380f4a19086fe60d

commit 3e6ad9f2b602083b39631981380f4a19086fe60d
Author: Tobias Tebbi <te...@chromium.org>
Date: Fri Jul 22 16:04:09 2022

[builtins] add builtins PGO profiling data for x64

Bug: v8:10470
Change-Id: I67e1962c17caecdf7cd9e8ac64ce7e4c0d694a21
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3776693
Reviewed-by: Igor Sheludko <ish...@chromium.org>
Commit-Queue: Tobias Tebbi <te...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81938}

[rename] https://crrev.com/3e6ad9f2b602083b39631981380f4a19086fe60d/tools/builtins-pgo/get_hints.py
[modify] https://crrev.com/3e6ad9f2b602083b39631981380f4a19086fe60d/src/compiler/pipeline.cc
[add] https://crrev.com/3e6ad9f2b602083b39631981380f4a19086fe60d/tools/builtins-pgo/generate.py
[modify] https://crrev.com/3e6ad9f2b602083b39631981380f4a19086fe60d/BUILD.gn
[add] https://crrev.com/3e6ad9f2b602083b39631981380f4a19086fe60d/tools/builtins-pgo/x64.profile
[rename] https://crrev.com/3e6ad9f2b602083b39631981380f4a19086fe60d/tools/builtins-pgo/combine_hints.py

Git Watcher via monorail

unread,
Jul 26, 2022, 10:46:06 AM7/26/22
to v8-re...@googlegroups.com

Comment #10 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c10


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/3064727d68004e85b771d7582f0c7d0cd5f3d1bc

commit 3064727d68004e85b771d7582f0c7d0cd5f3d1bc
Author: Tobias Tebbi <te...@chromium.org>
Date: Tue Jul 26 13:46:28 2022

[builtins] fix builtins PGO gn config and update x64

This is a follow-up to https://chromium-review.googlesource.com/c/v8/v8/+/3776693
The previous CL accidentally didn't manage to enable
the PGO build because `v8_optimized_debug` is true in
release builds.

Bug: v8:10470
Change-Id: I66ec74e71eb697aa48b981d78ad526f4b8c5a917
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3784989
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Igor Sheludko <ish...@chromium.org>
Auto-Submit: Tobias Tebbi <te...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81971}

[modify] https://crrev.com/3064727d68004e85b771d7582f0c7d0cd5f3d1bc/BUILD.gn
[modify] https://crrev.com/3064727d68004e85b771d7582f0c7d0cd5f3d1bc/tools/builtins-pgo/x64.profile

Git Watcher via monorail

unread,
Jul 27, 2022, 2:17:08 PM7/27/22
to v8-re...@googlegroups.com

Comment #11 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c11


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/8626a1bd272a84767dfd2d81f635ecf1865653e2

commit 8626a1bd272a84767dfd2d81f635ecf1865653e2
Author: Igor Sheludko <ish...@chromium.org>
Date: Wed Jul 27 11:48:38 2022

[builtins] Add builtins PGO profile for arm64

Bug: v8:10470
Change-Id: Icbd4c052b8d39300e45ab6fbee422839d852132b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3788207
Reviewed-by: Tobias Tebbi <te...@chromium.org>
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82010}

[add] https://crrev.com/8626a1bd272a84767dfd2d81f635ecf1865653e2/tools/builtins-pgo/arm64.profile
[modify] https://crrev.com/8626a1bd272a84767dfd2d81f635ecf1865653e2/tools/builtins-pgo/generate.py
[modify] https://crrev.com/8626a1bd272a84767dfd2d81f635ecf1865653e2/BUILD.gn

georg… via monorail

unread,
Aug 1, 2022, 7:15:23 AM8/1/22
to v8-re...@googlegroups.com

Comment #12 on issue 10470 by georg...@arm.com: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c12

Are there any plans to address the issues that may arise from committing the profile data?
For example, any CL that changes the scheduling graph may see regressions from simply preventing the profile data from being used, leading to a steady decline in performance as more and more of the profile data is ignored until the profile data is once again updated. Perhaps the profile data could be regenerated for each commit position before a pinpoint job is ran, using the same hardware that the benchmark will run on?

ish… via monorail

unread,
Aug 1, 2022, 7:34:55 AM8/1/22
to v8-re...@googlegroups.com
Updates:
Cc: ish...@chromium.org te...@chromium.org

Comment #13 on issue 10470 by ish...@chromium.org: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c13

Given how rare we change hot builtins or TurboFan we don't expect a lot of such issues.
On the other hand, it's already a known issue when a random change in some rarely used builtin might regress arm64 bots.
Currently, regenerating data on each commit seems too expensive. We'll start with updating the profile on a bi-weekly basis + before releases and see how the situation evolves.

georg… via monorail

unread,
Aug 1, 2022, 7:46:11 AM8/1/22
to v8-re...@googlegroups.com

Comment #14 on issue 10470 by georg...@arm.com: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c14

That sounds fairly reasonable, thanks for the response!

It might also be worth noting that I saw my best results from speedometer 2 profiles, or speedometer 2 profiles combined with jetstream 2 profiles.

ish… via monorail

unread,
Aug 1, 2022, 7:52:30 AM8/1/22
to v8-re...@googlegroups.com

Comment #15 on issue 10470 by ish...@chromium.org: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c15

Thanks! We are planning to experiment with collecting Speedometer2 profiles too.

ish… via monorail

unread,
Aug 2, 2022, 5:13:03 AM8/2/22
to v8-re...@googlegroups.com
Updates:
Cc: cbr...@chromium.org

Comment #16 on issue 10470 by ish...@chromium.org: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c16

(No comment was entered for this change.)

georg… via monorail

unread,
Aug 9, 2022, 7:28:02 AM8/9/22
to v8-re...@googlegroups.com

Comment #17 on issue 10470 by georg...@arm.com: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c17

I have submitted a CL that affects the arm64 backend and thus has disabled much of the profiling data currently committed, going from rejecting the data for 38 functions, to rejecting the data for 902 functions. This has caused many regressions, causing pinpoint to create many bugs and alerts.

https://bugs.chromium.org/p/chromium/issues/detail?id=1351200#c25
https://bugs.chromium.org/p/chromium/issues/detail?id=1351280#c5
https://bugs.chromium.org/p/chromium/issues/detail?id=1351309

To avoid this, perhaps some way of automatically regenerating the data and committing it in a follow up patch could be given to developers, so as to hide these regressions from pinpoint. Given the current state of things, it becomes very difficult to tell what is a regression due to PGO and what is a real regression due to the CL itself, making it easy to miss new regressions. The periodic updating of the profiling data, disconnected from the CLs that disable it also makes it difficult for pinpoint to know where any performance change, positive or negative may be coming from.

ish… via monorail

unread,
Aug 9, 2022, 11:46:05 AM8/9/22
to v8-re...@googlegroups.com

Comment #18 on issue 10470 by ish...@chromium.org: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c18

Ok, indeed it seems like we are having issues. We'll disable the PGO until next branch cut or until we have an automated solution or until we have a separate performance bots measuring release build with PGO.

Git Watcher via monorail

unread,
Aug 10, 2022, 4:54:21 AM8/10/22
to v8-re...@googlegroups.com

Comment #19 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c19


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/0e42fd298f5be0ca0de9f39744ba8ab7836390c0

commit 0e42fd298f5be0ca0de9f39744ba8ab7836390c0
Author: ish...@chromium.org <ish...@chromium.org>
Date: Tue Aug 09 16:12:26 2022

[builtins] Clear builtins PGO profiles until the next branch cut

Bug: v8:10470
Change-Id: I5208f4ae69fec1e76acacd8463d2238f34a0a770
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820484
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Tobias Tebbi <te...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82329}

[modify] https://crrev.com/0e42fd298f5be0ca0de9f39744ba8ab7836390c0/tools/builtins-pgo/arm64.profile
[modify] https://crrev.com/0e42fd298f5be0ca0de9f39744ba8ab7836390c0/tools/builtins-pgo/x64.profile

Git Watcher via monorail

unread,
Aug 10, 2022, 9:56:07 AM8/10/22
to v8-re...@googlegroups.com

Comment #20 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c20


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/012fa89948557ddc9d8bea1f5fee9e976a57a966

commit 012fa89948557ddc9d8bea1f5fee9e976a57a966
Author: Camillo <cbr...@chromium.org>
Date: Wed Aug 10 13:10:56 2022

[runtime] Improve builtins PGO logging

- Add explicit --turbo-profiling-output and --turbo-profiling-input
- Rename --turbo-profiling-log-file to --turbo-profiling-input
- No longer log PGO data to v8.log
- Add runtime %GetAndResetTurboProfilingData helper function for
more controlled logging within chrome
- Rewrite generate.py script to use more python3

Bug: v8:10470
Change-Id: Ib817b5c3793a0a7ae77103075ea2d6f6d0282150
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820381
Reviewed-by: Igor Sheludko <ish...@chromium.org>
Commit-Queue: Camillo Bruni <cbr...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82350}

[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/src/logging/log.h
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/src/flags/flag-definitions.h
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/src/diagnostics/basic-block-profiler.cc
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/src/diagnostics/basic-block-profiler.h
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/src/builtins/profile-data-reader.cc
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/src/runtime/runtime.h
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/tools/builtins-pgo/get_hints.py
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/src/execution/isolate.cc
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/src/runtime/runtime-internal.cc
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/src/init/v8.cc
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/tools/builtins-pgo/generate.py
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/BUILD.gn
[modify] https://crrev.com/012fa89948557ddc9d8bea1f5fee9e976a57a966/src/logging/log.cc

Git Watcher via monorail

unread,
Aug 12, 2022, 9:55:19 AM8/12/22
to v8-re...@googlegroups.com

Comment #21 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c21


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/2bfa1c377c09c4d01ff16a9f0edce3c6d4d2f589

commit 2bfa1c377c09c4d01ff16a9f0edce3c6d4d2f589
Author: ish...@chromium.org <ish...@chromium.org>
Date: Fri Aug 12 12:42:15 2022

[builtins] Allocate builtins PGO data in old space

... to please mksnapshot which expects the new space to be empty.

Bug: v8:10470
Change-Id: I7d5b62db138ef2e334581a8697d137cd13291d7c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3827877
Auto-Submit: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Camillo Bruni <cbr...@chromium.org>
Commit-Queue: Camillo Bruni <cbr...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82440}

[modify] https://crrev.com/2bfa1c377c09c4d01ff16a9f0edce3c6d4d2f589/src/heap/factory.h
[modify] https://crrev.com/2bfa1c377c09c4d01ff16a9f0edce3c6d4d2f589/src/heap/factory.cc
[modify] https://crrev.com/2bfa1c377c09c4d01ff16a9f0edce3c6d4d2f589/src/objects/objects.cc
[modify] https://crrev.com/2bfa1c377c09c4d01ff16a9f0edce3c6d4d2f589/src/objects/fixed-array.h

Git Watcher via monorail

unread,
Aug 22, 2022, 6:55:06 AM8/22/22
to v8-re...@googlegroups.com
Updates:
Labels: merge-merged-10.6

Comment #22 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c22


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/b702dd9231d82513fc850359c49e5a20302a3316

commit b702dd9231d82513fc850359c49e5a20302a3316
Author: ish...@chromium.org <ish...@chromium.org>
Date: Fri Aug 19 16:40:29 2022

[builtins] Update builtins PGO profiles for M106

Bug: v8:10470
Change-Id: I2aa80833edafaee19c74affe0006176270d8cedb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3840821
Reviewed-by: Lutz Vahl <va...@chromium.org>
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Cr-Commit-Position: refs/branch-heads/10.6@{#9}
Cr-Branched-From: 41bc7435693fbce8ef86753cd9239e30550a3e2d-refs/heads/10.6.194@{#1}
Cr-Branched-From: d5f29b929ce7746409201d77f44048f3e9529b40-refs/heads/main@{#82548}

[modify] https://crrev.com/b702dd9231d82513fc850359c49e5a20302a3316/tools/builtins-pgo/arm64.profile
[modify] https://crrev.com/b702dd9231d82513fc850359c49e5a20302a3316/tools/builtins-pgo/x64.profile

hao.a… via monorail

unread,
Aug 26, 2022, 3:48:50 AM8/26/22
to v8-re...@googlegroups.com

Comment #23 on issue 10470 by hao.a...@intel.com: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c23

I noticed that the default ratio for branch hint is 40 in get_hints.py. I'm wandering if we can further optimize the code layout by arranging the more-likely target in the "fall through" block of a forward branch, rather than defer the less-likely target. This can be applied when the ratio is 10~40. And this is consistent with the static branch prediction algorithm.

Git Watcher via monorail

unread,
Aug 29, 2022, 4:56:20 AM8/29/22
to v8-re...@googlegroups.com

Comment #24 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c24


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/fc6b16d17c8437677b8c5d0d541f800926b18b4f

commit fc6b16d17c8437677b8c5d0d541f800926b18b4f
Author: Igor Sheludko <ish...@chromium.org>
Date: Mon Aug 29 08:46:43 2022

[builtins] Fix typo in tools/builtins-pgo/generate.py

Bug: v8:10470
No-Tree-Checks: true
No-Try: true
Change-Id: Ic59bd42221776248dfc1bde35c1299aa4d1d3b0c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3861049
Auto-Submit: Igor Sheludko <ish...@chromium.org>
Commit-Queue: Camillo Bruni <cbr...@chromium.org>
Reviewed-by: Camillo Bruni <cbr...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82763}

[modify] https://crrev.com/fc6b16d17c8437677b8c5d0d541f800926b18b4f/tools/builtins-pgo/generate.py

Git Watcher via monorail

unread,
Aug 29, 2022, 8:31:08 AM8/29/22
to v8-re...@googlegroups.com

Comment #25 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c25


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/cf045ca244104e70a5c30bcea8f4d56cd5bfd8d9

commit cf045ca244104e70a5c30bcea8f4d56cd5bfd8d9
Author: Jakob Linke <jgr...@chromium.org>
Date: Mon Aug 29 11:42:58 2022

[mksnapshot] Ditch the warning on empty builtins PGO data

This is the normal state on the main branch, let's not emit this warning
on every build.

Bug: v8:10470
Change-Id: I29744ea7f67881570fa12c249b12f00d2313289c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3859851
Commit-Queue: Jakob Linke <jgr...@chromium.org>
Auto-Submit: Jakob Linke <jgr...@chromium.org>
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Igor Sheludko <ish...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82773}

[modify] https://crrev.com/cf045ca244104e70a5c30bcea8f4d56cd5bfd8d9/src/builtins/profile-data-reader.cc

Git Watcher via monorail

unread,
Sep 19, 2022, 4:17:30 AM9/19/22
to v8-re...@googlegroups.com

Comment #26 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c26


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/4c0e361446670086318c399674d7780ed523b13b

commit 4c0e361446670086318c399674d7780ed523b13b
Author: Igor Sheludko <ish...@chromium.org>
Date: Fri Sep 16 17:07:42 2022

[builtins] Use absolute log file name in tools/builtins-pgo/generate.py

... and report an error if the profile file can't be opened for writing.
Also, overwrite the profile file instead of appending if the file
exists.

Bug: v8:10470
Change-Id: I0da0ee8d901a0c477b7f71ba23436243f93bd0ee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3902521
Commit-Queue: Camillo Bruni <cbr...@chromium.org>
Auto-Submit: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Camillo Bruni <cbr...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83294}

[modify] https://crrev.com/4c0e361446670086318c399674d7780ed523b13b/src/execution/isolate.cc
[modify] https://crrev.com/4c0e361446670086318c399674d7780ed523b13b/tools/builtins-pgo/generate.py

Git Watcher via monorail

unread,
Sep 19, 2022, 5:39:07 AM9/19/22
to v8-re...@googlegroups.com
Updates:
Labels: merge-merged-10.7

Comment #27 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c27


The following revision refers to this bug:

Author: Igor Sheludko <ish...@chromium.org>
Date: Fri Sep 16 17:07:42 2022

Merged: [builtins] Use absolute log file name in tools/builtins-pgo/generate.py


... and report an error if the profile file can't be opened for writing.
Also, overwrite the profile file instead of appending if the file
exists.

Bug: v8:10470
(cherry picked from commit 4c0e361446670086318c399674d7780ed523b13b)

Change-Id: Iace28a9c3d20cefbc43bf7ce7c978fa0a0f28224
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3903822
Reviewed-by: Camillo Bruni <cbr...@chromium.org>
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Cr-Commit-Position: refs/branch-heads/10.7@{#6}
Cr-Branched-From: 4d2145cfb13e82642cda005b2f3fc7fad8ce0f67-refs/heads/10.7.193@{#1}
Cr-Branched-From: 95216968f57b136d9ef7afbbe40c9970b2758520-refs/heads/main@{#83201}

[modify] https://crrev.com/4404d6c448c828f4d62ad00595a1cc042cc5129b/src/execution/isolate.cc
[modify] https://crrev.com/4404d6c448c828f4d62ad00595a1cc042cc5129b/tools/builtins-pgo/generate.py

Git Watcher via monorail

unread,
Sep 19, 2022, 6:43:20 AM9/19/22
to v8-re...@googlegroups.com

Comment #28 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c28


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/3f704cc085396bd70608833317354be656ed9412

commit 3f704cc085396bd70608833317354be656ed9412
Author: Igor Sheludko <ish...@chromium.org>
Date: Mon Sep 19 09:59:01 2022

[builtins] Update builtins PGO profiles for M107

Bug: v8:10470
Change-Id: I6a9bc77b68831463899bc0247bf92ae79bf03d97
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3902584
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Lutz Vahl <va...@chromium.org>
Cr-Commit-Position: refs/branch-heads/10.7@{#8}

Cr-Branched-From: 4d2145cfb13e82642cda005b2f3fc7fad8ce0f67-refs/heads/10.7.193@{#1}
Cr-Branched-From: 95216968f57b136d9ef7afbbe40c9970b2758520-refs/heads/main@{#83201}

Git Watcher via monorail

unread,
Sep 19, 2022, 8:30:20 AM9/19/22
to v8-re...@googlegroups.com

Comment #29 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c29


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/bb706f599d6722f615261246bc67c87790b93573

commit bb706f599d6722f615261246bc67c87790b93573
Author: Igor Sheludko <ish...@chromium.org>
Date: Mon Sep 19 10:57:26 2022


[builtins] Update builtins PGO profiles for M107

Bug: v8:10470
Change-Id: I7c77ff5841a8a6d1ad1b98ff9cce27e492fb5f95
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3904301

Commit-Queue: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Lutz Vahl <va...@chromium.org>
Cr-Commit-Position: refs/branch-heads/10.7@{#10}

Cr-Branched-From: 4d2145cfb13e82642cda005b2f3fc7fad8ce0f67-refs/heads/10.7.193@{#1}
Cr-Branched-From: 95216968f57b136d9ef7afbbe40c9970b2758520-refs/heads/main@{#83201}

Git Watcher via monorail

unread,
Oct 14, 2022, 9:23:20 AM10/14/22
to v8-re...@googlegroups.com
Updates:
Labels: merge-merged-10.8

Comment #30 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c30


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/eb89c372a8b8cb5354638d7625b9fa12e7cb1f63

commit eb89c372a8b8cb5354638d7625b9fa12e7cb1f63
Author: Igor Sheludko <ish...@chromium.org>
Date: Fri Oct 14 09:21:37 2022

[builtins] Update builtins PGO profiles for M108

Bug: v8:10470
Change-Id: Ia01e055e0660b403043e7966449efe0681028c03
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3952255
Commit-Queue: Lutz Vahl <va...@chromium.org>
Reviewed-by: Lutz Vahl <va...@chromium.org>
Cr-Commit-Position: refs/branch-heads/10.8@{#2}
Cr-Branched-From: f1bc03fd6b4c201abd9f0fd9d51fb989150f97b9-refs/heads/10.8.168@{#1}
Cr-Branched-From: 237de893e1c0a0628a57d0f5797483d3add7f005-refs/heads/main@{#83672}

[modify] https://crrev.com/eb89c372a8b8cb5354638d7625b9fa12e7cb1f63/tools/builtins-pgo/arm64.profile
[modify] https://crrev.com/eb89c372a8b8cb5354638d7625b9fa12e7cb1f63/tools/builtins-pgo/x64.profile

Git Watcher via monorail

unread,
Oct 24, 2022, 4:53:07 AM10/24/22
to v8-re...@googlegroups.com

Comment #31 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c31


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/cd8a02d508df763d233c63d15e2d76b937738c21

commit cd8a02d508df763d233c63d15e2d76b937738c21
Author: Igor Sheludko <ish...@chromium.org>
Date: Fri Oct 21 11:50:24 2022

[builtins] Add --use-qemu mode to tools/builtins-pgo/generate.py

... and prepare for using PGO profiles for arm builds.

Bug: v8:10470
Change-Id: If71d363195c60277a59dc68d0c18e361e24209c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3970665
Auto-Submit: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Camillo Bruni <cbr...@chromium.org>
Commit-Queue: Camillo Bruni <cbr...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83867}

[modify] https://crrev.com/cd8a02d508df763d233c63d15e2d76b937738c21/tools/builtins-pgo/generate.py
[add] https://crrev.com/cd8a02d508df763d233c63d15e2d76b937738c21/tools/builtins-pgo/arm.profile
[modify] https://crrev.com/cd8a02d508df763d233c63d15e2d76b937738c21/BUILD.gn

Git Watcher via monorail

unread,
Oct 24, 2022, 6:31:24 AM10/24/22
to v8-re...@googlegroups.com

Comment #32 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c32


The following revision refers to this bug:

Author: Igor Sheludko <ish...@chromium.org>
Date: Fri Oct 21 11:50:24 2022

Merged: [builtins] Add --use-qemu mode to tools/builtins-pgo/generate.py


... and prepare for using PGO profiles for arm builds.

(cherry picked from commit cd8a02d508df763d233c63d15e2d76b937738c21)


Bug: v8:10470
Change-Id: If71d363195c60277a59dc68d0c18e361e24209c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3970665
Auto-Submit: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Camillo Bruni <cbr...@chromium.org>
Commit-Queue: Camillo Bruni <cbr...@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#83867}
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3974708

Commit-Queue: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Lutz Vahl <va...@chromium.org>
Commit-Queue: Lutz Vahl <va...@chromium.org>
Cr-Commit-Position: refs/branch-heads/10.8@{#10}

Cr-Branched-From: f1bc03fd6b4c201abd9f0fd9d51fb989150f97b9-refs/heads/10.8.168@{#1}
Cr-Branched-From: 237de893e1c0a0628a57d0f5797483d3add7f005-refs/heads/main@{#83672}

Git Watcher via monorail

unread,
Oct 24, 2022, 7:24:07 AM10/24/22
to v8-re...@googlegroups.com

Comment #33 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c33


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/29d7ae9961e5a8030977f3c751a65e63da011942

commit 29d7ae9961e5a8030977f3c751a65e63da011942
Author: Igor Sheludko <ish...@chromium.org>
Date: Mon Oct 24 10:39:24 2022

[builtins][arm] Update builtins PGO profiles for M108

Bug: v8:10470
Change-Id: Id7a7056d26acf0c07d93792def4b61a393460848
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3974711
Reviewed-by: Lutz Vahl <va...@chromium.org>
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Commit-Queue: Lutz Vahl <va...@chromium.org>
Cr-Commit-Position: refs/branch-heads/10.8@{#12}

Cr-Branched-From: f1bc03fd6b4c201abd9f0fd9d51fb989150f97b9-refs/heads/10.8.168@{#1}
Cr-Branched-From: 237de893e1c0a0628a57d0f5797483d3add7f005-refs/heads/main@{#83672}

Git Watcher via monorail

unread,
Nov 14, 2022, 8:51:21 AM11/14/22
to v8-re...@googlegroups.com
Updates:
Labels: merge-merged-10.9

Comment #34 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c34


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/dd7679e967f1668270111901d23c41ad455f6a9a

commit dd7679e967f1668270111901d23c41ad455f6a9a
Author: Igor Sheludko <ish...@chromium.org>
Date: Mon Nov 14 11:33:15 2022

[builtins] Update builtins PGO profiles for M109

Bug: v8:10470
Change-Id: I4a62b485ba13ef7060f55a2c09da711ae802bc44
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4023455

Commit-Queue: Lutz Vahl <va...@chromium.org>
Reviewed-by: Lutz Vahl <va...@chromium.org>
Cr-Commit-Position: refs/branch-heads/10.9@{#4}
Cr-Branched-From: 8ade6bf1fa237ad30dd9a05cc6ffe548131699e8-refs/heads/10.9.194@{#1}
Cr-Branched-From: 9ff2515271f11cab783f0e82678ae0b925d77dd0-refs/heads/main@{#84164}

[modify] https://crrev.com/dd7679e967f1668270111901d23c41ad455f6a9a/tools/builtins-pgo/arm64.profile
[modify] https://crrev.com/dd7679e967f1668270111901d23c41ad455f6a9a/tools/builtins-pgo/arm.profile
[modify] https://crrev.com/dd7679e967f1668270111901d23c41ad455f6a9a/tools/builtins-pgo/x64.profile

Git Watcher via monorail

unread,
Nov 25, 2022, 11:13:20 AM11/25/22
to v8-re...@googlegroups.com

Comment #35 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c35


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/7216ab0c0838c3ac15772404b4f85613990e5bd5

commit 7216ab0c0838c3ac15772404b4f85613990e5bd5
Author: Igor Sheludko <ish...@chromium.org>
Date: Fri Nov 25 15:18:57 2022

[csa][builtins-pgo] Make builtins architecture-independent, pt. 1

This CL moves the architecture-dependent Word32ShiftIsSafe() check
from C++ code to CSA graph in order to ensure that the builtins control
flow structure is architecture-independent.

Since the constant value is known at compile-time TurboFan will remove
the check and delete the dead code so in the end the generated code
will be the same and when the check was on C++ side.

However, having these checks in the CSA graph keeps the initial state
of graph structure the same for all architectures of the same bitness.
This allows reusing the x64/x86 builtins PGO profiles on arm64/arm
builds respectively.

Bug: v8:10470
Change-Id: I5a7a10dfbf905e542d14f05193ff3b3990288b87
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4055606
Reviewed-by: Tobias Tebbi <te...@chromium.org>
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84497}

[modify] https://crrev.com/7216ab0c0838c3ac15772404b4f85613990e5bd5/src/codegen/code-stub-assembler.cc
[modify] https://crrev.com/7216ab0c0838c3ac15772404b4f85613990e5bd5/src/compiler/code-assembler.h
[modify] https://crrev.com/7216ab0c0838c3ac15772404b4f85613990e5bd5/src/codegen/code-stub-assembler.h
[modify] https://crrev.com/7216ab0c0838c3ac15772404b4f85613990e5bd5/src/compiler/code-assembler.cc
[modify] https://crrev.com/7216ab0c0838c3ac15772404b4f85613990e5bd5/src/compiler/machine-graph.h
[modify] https://crrev.com/7216ab0c0838c3ac15772404b4f85613990e5bd5/src/compiler/machine-graph.cc

Git Watcher via monorail

unread,
Nov 28, 2022, 9:12:02 AM11/28/22
to v8-re...@googlegroups.com

Comment #36 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c36


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/7317006be892cf9185c5fb91a9576177da7e0dab

commit 7317006be892cf9185c5fb91a9576177da7e0dab
Author: Igor Sheludko <ish...@chromium.org>
Date: Fri Nov 25 16:33:03 2022

[csa][builtins-pgo] Make builtins architecture-independent, pt. 2

This CL moves the architecture-dependent IsFloat64RoundXXXSupported()
checks from C++ code to CSA graph in order to ensure that the builtins

control flow structure is architecture-independent.

Since the constant value is known at compile-time TurboFan will remove
the check and delete the dead code so in the end the generated code
will be the same and when the check was on C++ side.

However, having these checks in the CSA graph keeps the initial state
of graph structure the same for all architectures of the same bitness.
This allows reusing the x64/x86 builtins PGO profiles on arm64/arm
builds respectively.

Bug: v8:10470

Git Watcher via monorail

unread,
Nov 29, 2022, 10:41:23 AM11/29/22
to v8-re...@googlegroups.com

Comment #37 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c37


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/d0e79799160499832c6ead89aaf43a19c021d1b7

commit d0e79799160499832c6ead89aaf43a19c021d1b7
Author: Igor Sheludko <ish...@chromium.org>
Date: Mon Nov 28 18:07:04 2022

[csa][builtins-pgo] Make builtins architecture-independent, pt. 3

This CL moves the V8_ENABLE_FORCE_SLOW_PATH-dependent checks from C++

code to CSA graph in order to ensure that the builtins control flow
structure is V8_ENABLE_FORCE_SLOW_PATH-independent.


Since the constant value is known at compile-time TurboFan will remove
the check and delete the dead code so in the end the generated code
will be the same and when the check was on C++ side.

However, having these checks in the CSA graph keeps the initial state
of graph structure the same regardless of the V8_ENABLE_FORCE_SLOW_PATH
value which in turn makes the builtins PGO profiles reusable.

Bug: v8:10470
Change-Id: Ia0ddd1c099c5093a09904a8dd3aef748e0925540
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4061891
Auto-Submit: Igor Sheludko <ish...@chromium.org>
Commit-Queue: Tobias Tebbi <te...@chromium.org>
Reviewed-by: Tobias Tebbi <te...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84541}

[modify] https://crrev.com/d0e79799160499832c6ead89aaf43a19c021d1b7/src/codegen/code-stub-assembler.cc
[modify] https://crrev.com/d0e79799160499832c6ead89aaf43a19c021d1b7/src/builtins/builtins-regexp-gen.cc

Git Watcher via monorail

unread,
Nov 30, 2022, 5:30:46 AM11/30/22
to v8-re...@googlegroups.com

Comment #38 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c38


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/d0b408a84a0d72ed448ce72e844b3866bc2d630b

commit d0b408a84a0d72ed448ce72e844b3866bc2d630b
Author: Igor Sheludko <ish...@chromium.org>
Date: Tue Nov 29 13:59:08 2022

[builtins-pgo] Make builtins profiles architecture independent

Profiles for 64/32 bits architectures are not interchangeable but
profiles collected for x64/x86 can be used for arm64/arm respectively.

Attempt to use an incompatible profile is now a fatal build error.

Note that some Float64RoundXXX instructions that are available on
arm64 are not available on x64, so we generate a bunch of code
containing branches instead. This means that we are safe to use x64
profiles for arm64 but not the other way round, otherwise we'll miss
the profile info for the subgraph that's not generated on arm64.

Bug: v8:10470
Change-Id: I6a34836866363207b5ed767e343100b406ac7990
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4055274

Reviewed-by: Tobias Tebbi <te...@chromium.org>
Commit-Queue: Igor Sheludko <ish...@chromium.org>

wenqi… via monorail

unread,
Dec 1, 2022, 9:14:07 PM12/1/22
to v8-re...@googlegroups.com

Comment #39 on issue 10470 by wenqi...@intel.com: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c39

Hi All,

According to our previous discussion (https://docs.google.com/document/d/1D28v5iXS6sIhT2rtQOIy8VC-koVJUJ7QHsxilPqD4vQ/edit#heading=h.poxq80s7k3sd), I finished a PoC of reordering buitlins in function level based on current builtin PGO framework, it reprots 0.5% benefits from pinpoint: https://pinpoint-dot-chromeperf.appspot.com/job/11985b48da0000, here is CL: https://chromium-review.googlesource.com/c/v8/v8/+/4004689

If you think this is a good extension of builtin PGO, I will clean up the code and submit this CL.

hao.a… via monorail

unread,
Dec 1, 2022, 9:22:01 PM12/1/22
to v8-re...@googlegroups.com
Updates:
Cc: wenqi...@intel.com

Comment #40 on issue 10470 by hao.a...@intel.com: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c40


(No comment was entered for this change.)

ish… via monorail

unread,
Dec 2, 2022, 6:37:22 AM12/2/22
to v8-re...@googlegroups.com

Comment #41 on issue 10470 by ish...@chromium.org: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c41

Hi! Thank you! I added comments to the doc.

Git Watcher via monorail

unread,
Dec 15, 2022, 9:29:09 AM12/15/22
to v8-re...@googlegroups.com
Updates:
Labels: merge-merged-11.0

Comment #42 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c42


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/08174236d3851892cf0d47e8ab706b84bd3158e2

commit 08174236d3851892cf0d47e8ab706b84bd3158e2
Author: Alexander Schulze <alexs...@chromium.org>
Date: Thu Dec 15 11:36:17 2022

[builtins] Update builtins PGO profiles for M110

Bug: v8:10470
Change-Id: I2241da5f5f60855e94776c0478bc87bc2d06ba84
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111160
Reviewed-by: Igor Sheludko <ish...@chromium.org>
Commit-Queue: Alexander Schulze <alexs...@chromium.org>
Cr-Commit-Position: refs/branch-heads/11.0@{#2}
Cr-Branched-From: 06097c6f0c5af54fd5d6965d37027efb72decd4f-refs/heads/11.0.226@{#1}
Cr-Branched-From: 6bf3344f5d9940de1ab253f1817dcb99c641c9d3-refs/heads/main@{#84857}

[modify] https://crrev.com/08174236d3851892cf0d47e8ab706b84bd3158e2/tools/builtins-pgo/x86.profile
[modify] https://crrev.com/08174236d3851892cf0d47e8ab706b84bd3158e2/tools/builtins-pgo/x64.profile

Git Watcher via monorail

unread,
Jan 9, 2023, 10:23:23 AM1/9/23
to v8-re...@googlegroups.com

Comment #43 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c43


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/20ca6e09af8b26ba81c41b6e23249289eca2eb71

commit 20ca6e09af8b26ba81c41b6e23249289eca2eb71
Author: Leszek Swirski <les...@chromium.org>
Date: Mon Jan 09 12:52:12 2023

[builtins] Update builtins PGO profiles for M110 (re-try)

Bug: v8:10470
Change-Id: Id9d82173ed776ce4237e6cd36d39bbd7f05ca539
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4146434
Reviewed-by: Alexander Schulze <alexs...@chromium.org>
Commit-Queue: Leszek Swirski <les...@chromium.org>
Cr-Commit-Position: refs/branch-heads/11.0@{#14}

Cr-Branched-From: 06097c6f0c5af54fd5d6965d37027efb72decd4f-refs/heads/11.0.226@{#1}
Cr-Branched-From: 6bf3344f5d9940de1ab253f1817dcb99c641c9d3-refs/heads/main@{#84857}

Git Watcher via monorail

unread,
Jan 26, 2023, 9:06:36 AM1/26/23
to v8-re...@googlegroups.com
Updates:
Labels: merge-merged-11.1

Comment #44 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c44


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/d47e30bbc143b05d0878691e7670e94218b93582

commit d47e30bbc143b05d0878691e7670e94218b93582
Author: Alexander Schulze <alexs...@chromium.org>
Date: Thu Jan 26 13:24:21 2023

[builtins] Update builtins PGO profiles for M111

Additionally, this disables failing for invalid profiles. See
crbug.com/v8/13647 for details.

Bug: v8:10470,v8:13647
Change-Id: I35c7bb79ea903754f0ee8872ed0e0938c1a1b964
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4197346
Reviewed-by: Lutz Vahl <va...@chromium.org>
Commit-Queue: Alexander Schulze <alexs...@chromium.org>
Cr-Commit-Position: refs/branch-heads/11.1@{#2}
Cr-Branched-From: c77793a2ee5bfa7c5226dd8f622bf331b97a5a25-refs/heads/11.1.277@{#1}
Cr-Branched-From: 95b79bf04ba3f9de87f7bad77bc2d7552e5dc4d7-refs/heads/main@{#85479}

[modify] https://crrev.com/d47e30bbc143b05d0878691e7670e94218b93582/tools/builtins-pgo/x86.profile
[modify] https://crrev.com/d47e30bbc143b05d0878691e7670e94218b93582/BUILD.gn
[modify] https://crrev.com/d47e30bbc143b05d0878691e7670e94218b93582/tools/builtins-pgo/x64.profile

Git Watcher via monorail

unread,
Feb 23, 2023, 11:02:25 AM2/23/23
to v8-re...@googlegroups.com
Updates:
Labels: merge-merged-11.2

Comment #45 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c45


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/91ea35db95fb562a93c53739f506245fcc1a975c

commit 91ea35db95fb562a93c53739f506245fcc1a975c
Author: Alexander Schulze <alexs...@chromium.org>
Date: Thu Feb 23 13:58:55 2023


[builtins] Update builtins PGO profiles for M111

Bug: v8:10470
Change-Id: I5f00e32d69ca4d4951104aae66d6f601f00d00aa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4287083

Commit-Queue: Lutz Vahl <va...@chromium.org>
Reviewed-by: Lutz Vahl <va...@chromium.org>
Cr-Commit-Position: refs/branch-heads/11.2@{#3}
Cr-Branched-From: 755511a138609ac5939449a8ac615c15603a4454-refs/heads/11.2.214@{#1}
Cr-Branched-From: e6b1ccefb0f0f1ff8d310578878130dc53d73749-refs/heads/main@{#86014}

[modify] https://crrev.com/91ea35db95fb562a93c53739f506245fcc1a975c/tools/builtins-pgo/x86.profile
[modify] https://crrev.com/91ea35db95fb562a93c53739f506245fcc1a975c/tools/builtins-pgo/x64.profile

Git Watcher via monorail

unread,
Feb 23, 2023, 1:28:10 PM2/23/23
to v8-re...@googlegroups.com

Comment #46 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c46


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/0ee95184a30d0b7052c64d67797219acf5807e77

commit 0ee95184a30d0b7052c64d67797219acf5807e77
Author: Adam Klein <ad...@chromium.org>
Date: Thu Feb 23 18:23:51 2023

Revert "[builtins] Update builtins PGO profiles for M111"

This reverts commit 91ea35db95fb562a93c53739f506245fcc1a975c.

Reason for revert: breaks mksnapshot on 11.2 beta waterfall

Original change's description:

> [builtins] Update builtins PGO profiles for M111
>
> Bug: v8:10470
> Change-Id: I5f00e32d69ca4d4951104aae66d6f601f00d00aa
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4287083
> Commit-Queue: Lutz Vahl <va...@chromium.org>
> Reviewed-by: Lutz Vahl <va...@chromium.org>
> Cr-Commit-Position: refs/branch-heads/11.2@{#3}
> Cr-Branched-From: 755511a138609ac5939449a8ac615c15603a4454-refs/heads/11.2.214@{#1}
> Cr-Branched-From: e6b1ccefb0f0f1ff8d310578878130dc53d73749-refs/heads/main@{#86014}

Bug: v8:10470, v8:13768
Change-Id: I5fe636170ea383e9d54777cfbd939f051ce4bb2b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4287629
Bot-Commit: Rubber Stamper <rubber-...@appspot.gserviceaccount.com>
Commit-Queue: Adam Klein <ad...@chromium.org>
Cr-Commit-Position: refs/branch-heads/11.2@{#5}

Cr-Branched-From: 755511a138609ac5939449a8ac615c15603a4454-refs/heads/11.2.214@{#1}
Cr-Branched-From: e6b1ccefb0f0f1ff8d310578878130dc53d73749-refs/heads/main@{#86014}

Git Watcher via monorail

unread,
Feb 23, 2023, 3:25:08 PM2/23/23
to v8-re...@googlegroups.com

Comment #47 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c47


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/734846548b4e868802c9713d8f31b1589dfb3fb6

commit 734846548b4e868802c9713d8f31b1589dfb3fb6
Author: Alexander Schulze <alexs...@chromium.org>
Date: Thu Feb 23 19:21:17 2023

[builtins] Update builtins PGO profiles for M112

Bug: v8:10470
Change-Id: I17074d0675b1dcd89d5956381548ac468cd0f081
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4286949
Reviewed-by: Adam Klein <ad...@chromium.org>
Commit-Queue: Alexander Schulze <alexs...@chromium.org>
Cr-Commit-Position: refs/branch-heads/11.2@{#7}

Cr-Branched-From: 755511a138609ac5939449a8ac615c15603a4454-refs/heads/11.2.214@{#1}
Cr-Branched-From: e6b1ccefb0f0f1ff8d310578878130dc53d73749-refs/heads/main@{#86014}

Git Watcher via monorail

unread,
Mar 31, 2023, 10:08:08 AM3/31/23
to v8-re...@googlegroups.com

Comment #48 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c48


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/9505ec02eced187af2721546c84bef76846b5c4c

commit 9505ec02eced187af2721546c84bef76846b5c4c
Author: Igor Sheludko <ish...@chromium.org>
Date: Fri Mar 31 13:31:06 2023

[builtins-pgo] Make builtins profiles MSVC-independent

There was a dependency on availability of SIMD operations for
Array.prototype.includes() builtins which led to different CSA graphs
and as a result to a builtins PGO profile rejection on MSVC builds.

Bug: v8:10470, v8:13647
Change-Id: I8f19831aa218b2a92b1d8cc05d9efbfe093bab9e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4388601
Auto-Submit: Igor Sheludko <ish...@chromium.org>
Commit-Queue: Leszek Swirski <les...@chromium.org>
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Reviewed-by: Leszek Swirski <les...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#86834}

[modify] https://crrev.com/9505ec02eced187af2721546c84bef76846b5c4c/src/builtins/builtins-array-gen.cc

Git Watcher via monorail

unread,
Apr 6, 2023, 10:18:09 AM4/6/23
to v8-re...@googlegroups.com

Comment #49 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c49


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/d3c41fe24381f29a537728c88c3a3b07af1a4208

commit d3c41fe24381f29a537728c88c3a3b07af1a4208
Author: Igor Sheludko <ish...@chromium.org>
Date: Thu Apr 06 13:21:10 2023

[builtins-pgo] Make profiles applicable for Android

There was a graph structure dependency on the kExternalPointerIndexShift
value.

Bug: v8:10470, chromium:1430848
Change-Id: I13ffbf804713fda80e508b113d0156292bf88cda
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4406046
Reviewed-by: Toon Verwaest <verw...@chromium.org>
Commit-Queue: Toon Verwaest <verw...@chromium.org>
Commit-Queue: Igor Sheludko <ish...@chromium.org>
Auto-Submit: Igor Sheludko <ish...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#86975}

[modify] https://crrev.com/d3c41fe24381f29a537728c88c3a3b07af1a4208/src/compiler/code-assembler.h
[modify] https://crrev.com/d3c41fe24381f29a537728c88c3a3b07af1a4208/src/codegen/code-stub-assembler.cc

Git Watcher via monorail

unread,
Jun 14, 2023, 8:50:08 AM6/14/23
to v8-re...@googlegroups.com

Comment #50 on issue 10470 by Git Watcher: Tracking bug: profile-guided optimization of builtins
https://bugs.chromium.org/p/v8/issues/detail?id=10470#c50


The following revision refers to this bug:
https://chromium.googlesource.com/v8/v8/+/15233a63c3f1cb11808f9622d0d4211787c96db3

commit 15233a63c3f1cb11808f9622d0d4211787c96db3
Author: Andreas Haas <ah...@chromium.org>
Date: Wed Jun 14 11:07:28 2023

[csa] Add UniqueIntPtrConstant

This CL introduces `UniqueIntPtrConstant` according to the existing
`UniqueInt32Constant`. `UniqueIntPtrConstant` always creates a new node
instead of trying to reuse a cached node as `IntPtrConstant` would.

The reason is that PGO needs builtin graphs to look the same for x64
and arm64 (also for ia32 and arm). However, constants may be different
on different platforms, and node sharing may be different for different
constants. Therefore different constants can then make graphs be
different. `UniqueIntPtrConstant` solves this problem by avoiding node
sharing.

Bug: v8:10470

Change-Id: Ia96e6870bf8ed3deccc19a0fa08afeba088c742a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4614463
Reviewed-by: Igor Sheludko <ish...@chromium.org>
Commit-Queue: Andreas Haas <ah...@chromium.org>
Reviewed-by: Darius Mercadier <dmerc...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#88231}

[modify] https://crrev.com/15233a63c3f1cb11808f9622d0d4211787c96db3/src/compiler/code-assembler.h
[modify] https://crrev.com/15233a63c3f1cb11808f9622d0d4211787c96db3/src/compiler/code-assembler.cc
[modify] https://crrev.com/15233a63c3f1cb11808f9622d0d4211787c96db3/src/compiler/machine-graph.h
[modify] https://crrev.com/15233a63c3f1cb11808f9622d0d4211787c96db3/src/compiler/machine-graph.cc
Reply all
Reply to author
Forward
0 new messages