Skip to content

Commit 0188e14

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 c2a7c2a commit 0188e14

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

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

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

0 commit comments

Comments
 (0)