mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[3.14] gh-141808: Don't remove the JIT stencils when building with PGO (GH-141809) (GH-142657)
See: https://discuss.python.org/t/building-the-jit-with-pre-built-stencils/91838/12
(cherry picked from commit 8914148151)
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
This commit is contained in:
parent
27f27a68b3
commit
73c80f69ba
2 changed files with 15 additions and 4 deletions
|
|
@ -834,7 +834,7 @@ check-app-store-compliance:
|
||||||
|
|
||||||
# Profile generation build must start from a clean tree.
|
# Profile generation build must start from a clean tree.
|
||||||
profile-clean-stamp:
|
profile-clean-stamp:
|
||||||
$(MAKE) clean
|
$(MAKE) clean-profile
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
# Compile with profile generation enabled.
|
# Compile with profile generation enabled.
|
||||||
|
|
@ -3222,7 +3222,6 @@ clean-retain-profile: pycremoval
|
||||||
-rm -rf Python/deepfreeze
|
-rm -rf Python/deepfreeze
|
||||||
-rm -f Python/frozen_modules/*.h
|
-rm -f Python/frozen_modules/*.h
|
||||||
-rm -f Python/frozen_modules/MANIFEST
|
-rm -f Python/frozen_modules/MANIFEST
|
||||||
-rm -f jit_stencils.h
|
|
||||||
-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
|
-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
|
||||||
-rm -f Include/pydtrace_probes.h
|
-rm -f Include/pydtrace_probes.h
|
||||||
-rm -f profile-gen-stamp
|
-rm -f profile-gen-stamp
|
||||||
|
|
@ -3241,13 +3240,21 @@ profile-removal:
|
||||||
rm -f profile-run-stamp
|
rm -f profile-run-stamp
|
||||||
rm -f profile-bolt-stamp
|
rm -f profile-bolt-stamp
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean-profile
|
||||||
clean: clean-retain-profile clean-bolt
|
clean-profile: clean-retain-profile clean-bolt
|
||||||
@if test @DEF_MAKE_ALL_RULE@ = profile-opt -o @DEF_MAKE_ALL_RULE@ = bolt-opt; then \
|
@if test @DEF_MAKE_ALL_RULE@ = profile-opt -o @DEF_MAKE_ALL_RULE@ = bolt-opt; then \
|
||||||
rm -f profile-gen-stamp profile-clean-stamp; \
|
rm -f profile-gen-stamp profile-clean-stamp; \
|
||||||
$(MAKE) profile-removal; \
|
$(MAKE) profile-removal; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# gh-141808: The JIT stencils are deliberately kept in clean-profile
|
||||||
|
.PHONY: clean-jit-stencils
|
||||||
|
clean-jit-stencils:
|
||||||
|
-rm -f jit_stencils*.h
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean: clean-profile clean-jit-stencils
|
||||||
|
|
||||||
.PHONY: clobber
|
.PHONY: clobber
|
||||||
clobber: clean
|
clobber: clean
|
||||||
-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
|
-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
When running ``make clean-retain-profile``, keep the
|
||||||
|
generated JIT stencils. That way, the stencils are not generated twice when
|
||||||
|
Profile-guided optimization (PGO) is used. It also allows distributors to
|
||||||
|
supply their own pre-built JIT stencils.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue