Skip to content

Commit 020f82c

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 41ee2c9 commit 020f82c

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
@@ -616,7 +616,7 @@ profile-gen-stamp: profile-clean-stamp
616616
exit 1;\
617617
fi
618618
@echo "Building with support for profile generation:"
619-
$(MAKE) build_all_generate_profile
619+
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
620620
touch $@
621621

622622
# Run task with profile generation build to create profile information.
@@ -626,28 +626,16 @@ profile-run-stamp:
626626
# enabled.
627627
$(MAKE) profile-gen-stamp
628628
# Next, run the profile task to generate the profile information.
629-
$(MAKE) run_profile_task
630-
$(MAKE) build_all_merge_profile
629+
@ # FIXME: can't run for a cross build
630+
$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
631+
$(LLVM_PROF_MERGER)
631632
# Remove profile generation binary since we are done with it.
632633
$(MAKE) clean-retain-profile
633634
# This is an expensive target to build and it does not have proper
634635
# makefile dependency information. So, we create a "stamp" file
635636
# to record its completion and avoid re-running it.
636637
touch $@
637638

638-
.PHONY: build_all_generate_profile
639-
build_all_generate_profile:
640-
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
641-
642-
.PHONY: run_profile_task
643-
run_profile_task:
644-
@ # FIXME: can't run for a cross build
645-
$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
646-
647-
.PHONY: build_all_merge_profile
648-
build_all_merge_profile:
649-
$(LLVM_PROF_MERGER)
650-
651639
# Compile Python binary with profile guided optimization.
652640
# To force re-running of the profile task, remove the profile-run-stamp file.
653641
.PHONY: profile-opt

0 commit comments

Comments
 (0)