diff options
author | Andi Kleen <ak@linux.intel.com> | 2016-06-23 14:34:16 +0000 |
---|---|---|
committer | Andi Kleen <ak@gcc.gnu.org> | 2016-06-23 14:34:16 +0000 |
commit | 277d7ee0c95456a21ef371aa025791cbef883169 (patch) | |
tree | a64cadd18e82bbd81f52a690484f43fc66291fdc /gcc/cp/Make-lang.in | |
parent | 7f586d904de25044a08f99669df5bc1ed2fa9f26 (diff) | |
download | gcc-277d7ee0c95456a21ef371aa025791cbef883169.zip gcc-277d7ee0c95456a21ef371aa025791cbef883169.tar.gz gcc-277d7ee0c95456a21ef371aa025791cbef883169.tar.bz2 |
Add make autoprofiledbootstrap
Add support for profiledbootstrap with autofdo. Will be useful
to get better testing coverage of autofdo.
This requires Linux perf and autofdo to be installed, only
really for x86_64 linux on Intel so far.
Profile the whole build process with perf, then convert the file,
and pass it back to the compiler in the feedback stage.
The conversion has to be done per language, as only that knows
the name of the binary. Currently we only do it for C and C++,
as the other languages don't have enough coverage during a normal
bootstrap.
For lto1 it is also disabled, because it would only be useful during a LTO
bootstrap, but right now autofdo and LTO are not working together due to
PR66229
For common backend files always the profile output of the C++ compiler
is used. In theory multiple inputs could be merged here, but so far
that is not implemented.
The method is not friendly to partial rebuilds, as only the profile
information from the current rebuild is used. So if an error
occurs it is best to clean and restart, otherwise the code
quality may be worse.
This patch is fairly large, but most of it is auto generated from
autogen in Makefile.in. for the new stage targets.
Passes profiledbootstrap and normal bootstrap on x86_64-linux.
autoprofiledbootstrap is currently not working due to
PR70427 (but it finishes with that worked around)
The autofdo'ed compiler is ~7% faster on insn-recog.i (vs ~11% for
profiledfeedback), and ~4% faster for tramp3d-v4 (vs 10% for
profiledfeedback) on a Sandy Bridge system.
gcc/lto/:
2016-06-23 Andi Kleen <ak@linux.intel.com>
* Make-lang.in: Add support for autofdo (disabled for now)
gcc/cp/:
2016-06-23 Andi Kleen <ak@linux.intel.com>
* Make-lang.in: Add support for autofdo.
gcc/:
2016-06-23 Andi Kleen <ak@linux.intel.com>
* Makefile.in: Regenerate.
* doc/install.texi: Document autoprofiledbootstrap.
/:
2016-06-23 Andi Kleen <ak@linux.intel.com>
* Makefile.def: Add autoprofiledbootstrap.
* Makefile.tpl: Dito.
* Makefile.in: Regenerate.
gcc/c/:
2016-06-23 Andi Kleen <ak@linux.intel.com>
* Make-lang.in: Add support for autofdo.
From-SVN: r237733
Diffstat (limited to 'gcc/cp/Make-lang.in')
-rw-r--r-- | gcc/cp/Make-lang.in | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 625a77c..c1f26ea 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -81,6 +81,11 @@ CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \ cp/vtable-class-hierarchy.o cp/constexpr.o cp/cp-ubsan.o \ cp/constraint.o cp/logic.o $(CXX_C_OBJS) +ifeq ($(shell cat ../stage_current),stageautofeedback) +$(CXX_AND_OBJCXX_OBJS): CFLAGS += -fauto-profile=cc1plus.fda +$(CXX_AND_OBJCXX_OBJS): cc1plus.fda +endif + # Language-specific object files for C++. CXX_OBJS = cp/cp-lang.o c-family/stub-objc.o $(CXX_AND_OBJCXX_OBJS) @@ -122,6 +127,9 @@ endif gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h +cc1plus.fda: ../stage1-gcc/cc1plus$(exeext) ../prev-gcc/$(PERF_DATA) + $(CREATE_GCOV) -binary ../stage1-gcc/cc1plus$(exeext) -gcov cc1plus.fda -profile ../prev-gcc/$(PERF_DATA) -gcov_version 1 + # # Build hooks: @@ -235,7 +243,7 @@ c++.mostlyclean: -rm -f doc/g++.1 -rm -f cp/*$(objext) -rm -f cp/*$(coverageexts) - -rm -f xg++$(exeext) g++-cross$(exeext) cc1plus$(exeext) + -rm -f xg++$(exeext) g++-cross$(exeext) cc1plus$(exeext) cc1plus.fda c++.clean: c++.distclean: -rm -f cp/config.status cp/Makefile @@ -257,3 +265,7 @@ c++.stageprofile: stageprofile-start -mv cp/*$(objext) stageprofile/cp c++.stagefeedback: stagefeedback-start -mv cp/*$(objext) stagefeedback/cp +c++.autostageprofile: stageprofile-start + -mv cp/*$(objext) autostageprofile/cp +c++.autostagefeedback: stagefeedback-start + -mv cp/*$(objext) autostagefeedback/cp |