diff options
author | Gregory Szorc <gregory.szorc@gmail.com> | 2023-05-22 11:45:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-22 11:45:20 (GMT) |
commit | 5360cb3d5608ab375de6cd8c0b408459f3fa953a (patch) | |
tree | d6256db9d1a0db997b881d26a2ed774f43bd5ff9 /.gitignore | |
parent | 729b252241966f464cc46e176fb854dbcc5296cb (diff) | |
download | cpython-5360cb3d5608ab375de6cd8c0b408459f3fa953a.zip cpython-5360cb3d5608ab375de6cd8c0b408459f3fa953a.tar.gz cpython-5360cb3d5608ab375de6cd8c0b408459f3fa953a.tar.bz2 |
gh-101282: Apply BOLT optimizations to libpython for shared builds (#104709)
Apply BOLT optimizations to libpython for shared builds. Most of the C
code is in libpython so it is critical to apply BOLT there fully realize
BOLT benefits.
This change also reworks how BOLT instrumentation is applied. It
effectively removes the readelf based logic added in gh-101525 and
replaces it with a mechanism that saves a copy of the pre-bolt binary
and restores that copy when necessary. This allows us to perform BOLT
optimizations without having to manually delete the output binary to
force a new bolt run.
Also:
- add a clean-bolt target for purging BOLT files and hook that up to the
clean target
- .gitignore BOLT related files
Before and after this refactor, `make` will no-op after a previous run.
Both versions should also share common make DAG deficiencies where
targets fail to trigger as often as they need to or can trigger
prematurely in certain scenarios. e.g. after this change you may need to
`rm profile-bolt-stamp` to force a BOLT run because there aren't
appropriate non-phony targets for BOLT's make target to depend on.
To make it easier to iterate on custom BOLT settings, the flags to pass
to instrumentation and application are now defined in configure and can
be overridden by passing BOLT_INSTRUMENT_FLAGS and BOLT_APPLY_FLAGS.
Diffstat (limited to '.gitignore')
-rw-r--r-- | .gitignore | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -23,6 +23,10 @@ *.gc?? *.profclang? *.profraw +# Copies of binaries before BOLT optimizations. +*.prebolt +# BOLT profile data. +*.fdata *.dyn .gdb_history .purify @@ -124,6 +128,7 @@ Tools/unicode/data/ /platform /profile-clean-stamp /profile-run-stamp +/profile-bolt-stamp /Python/deepfreeze/*.c /pybuilddir.txt /pyconfig.h |