mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 23:37:33 +09:00
PGO and LTO in clang-cl
This commit is contained in:
parent
6569a453d2
commit
70b4a79405
12 changed files with 290 additions and 15 deletions
|
|
@ -210,13 +210,25 @@ ifdef CPP_UNIT_TESTS
|
|||
NO_PROFILE_GUIDED_OPTIMIZE = 1
|
||||
endif
|
||||
|
||||
# Reject stale Windows PGO configuration before compiling the first pass.
|
||||
ifdef MOZ_PGO
|
||||
ifdef CLANG_CL
|
||||
ifeq ($(strip $(LLVM_PROFDATA)),)
|
||||
$(error clang-cl PGO requires LLVM_PROFDATA; rerun ./mach configure)
|
||||
endif
|
||||
ifeq ($(filter -clang:-fprofile-instr-generate,$(PROFILE_GEN_CFLAGS)),)
|
||||
$(error clang-cl PGO requires LLVM instrumentation flags; rerun ./mach configure)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Enable profile-based feedback
|
||||
ifneq (1,$(NO_PROFILE_GUIDED_OPTIMIZE))
|
||||
ifdef MOZ_PROFILE_GENERATE
|
||||
OS_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS))
|
||||
OS_CXXFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS))
|
||||
OS_LDFLAGS += $(PROFILE_GEN_LDFLAGS)
|
||||
ifeq (WINNT,$(OS_ARCH))
|
||||
ifeq ($(OS_ARCH)_$(CLANG_CL),WINNT_)
|
||||
AR_FLAGS += -LTCG
|
||||
endif
|
||||
endif # MOZ_PROFILE_GENERATE
|
||||
|
|
@ -225,7 +237,7 @@ ifdef MOZ_PROFILE_USE
|
|||
OS_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_USE_CFLAGS))
|
||||
OS_CXXFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_USE_CFLAGS))
|
||||
OS_LDFLAGS += $(PROFILE_USE_LDFLAGS)
|
||||
ifeq (WINNT,$(OS_ARCH))
|
||||
ifeq ($(OS_ARCH)_$(CLANG_CL),WINNT_)
|
||||
AR_FLAGS += -LTCG
|
||||
endif
|
||||
endif # MOZ_PROFILE_USE
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ endif
|
|||
##############################################
|
||||
ifneq (1,$(NO_PROFILE_GUIDED_OPTIMIZE))
|
||||
ifdef MOZ_PROFILE_USE
|
||||
ifeq ($(OS_ARCH)_$(GNU_CC), WINNT_)
|
||||
ifeq ($(OS_ARCH)_$(GNU_CC)_$(CLANG_CL), WINNT__)
|
||||
# When building with PGO, we have to make sure to re-link
|
||||
# in the MOZ_PROFILE_USE phase if we linked in the
|
||||
# MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink
|
||||
|
|
@ -563,7 +563,7 @@ endif # MOZ_PROFILE_USE
|
|||
ifdef MOZ_PROFILE_GENERATE
|
||||
# Clean up profiling data during PROFILE_GENERATE phase
|
||||
export::
|
||||
ifeq ($(OS_ARCH)_$(GNU_CC), WINNT_)
|
||||
ifeq ($(OS_ARCH)_$(GNU_CC)_$(CLANG_CL), WINNT__)
|
||||
$(foreach pgd,$(wildcard *.pgd),pgomgr -clear $(pgd);)
|
||||
else
|
||||
ifdef GNU_CC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue