Skip to content

Commit deeb269

Browse files
committed
gh-xxxx: inline minimal PGO rules
Various rules were only ever invoked once from other This rule is only ever invoked from `profile-gen-stamp` and all it does is turn around and invoke `make @DEF_MAKE_RULE@`. I don't see a strong reason for this indirection to exist, as it harms comprehension.
1 parent 324f01d commit deeb269

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

Makefile.pre.in

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ profile-gen-stamp: profile-clean-stamp
640640
exit 1;\
641641
fi
642642
@echo "Building with support for profile generation:"
643-
$(MAKE) build_all_generate_profile
643+
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
644644
touch $@
645645

646646
# Run task with profile generation build to create profile information.
@@ -650,28 +650,16 @@ profile-run-stamp:
650650
# enabled.
651651
$(MAKE) profile-gen-stamp
652652
# Next, run the profile task to generate the profile information.
653-
$(MAKE) run_profile_task
654-
$(MAKE) build_all_merge_profile
653+
@ # FIXME: can't run for a cross build
654+
$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
655+
$(LLVM_PROF_MERGER)
655656
# Remove profile generation binary since we are done with it.
656657
$(MAKE) clean-retain-profile
657658
# This is an expensive target to build and it does not have proper
658659
# makefile dependency information. So, we create a "stamp" file
659660
# to record its completion and avoid re-running it.
660661
touch $@
661662

662-
.PHONY: build_all_generate_profile
663-
build_all_generate_profile:
664-
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
665-
666-
.PHONY: run_profile_task
667-
run_profile_task:
668-
@ # FIXME: can't run for a cross build
669-
$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
670-
671-
.PHONY: build_all_merge_profile
672-
build_all_merge_profile:
673-
$(LLVM_PROF_MERGER)
674-
675663
# Compile Python binary with profile guided optimization.
676664
# To force re-running of the profile task, remove the profile-run-stamp file.
677665
.PHONY: profile-opt

0 commit comments

Comments
 (0)