Skip to content

Commit

Permalink
Add make autoprofiledbootstrap
Browse files Browse the repository at this point in the history
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  <[email protected]>

	* Make-lang.in: Add support for autofdo (disabled for now)

gcc/cp/:

2016-06-23  Andi Kleen  <[email protected]>

	* Make-lang.in: Add support for autofdo.

gcc/:

2016-06-23  Andi Kleen  <[email protected]>

	* Makefile.in: Regenerate.
	* doc/install.texi: Document autoprofiledbootstrap.

/:
2016-06-23  Andi Kleen  <[email protected]>

	* Makefile.def: Add autoprofiledbootstrap.
	* Makefile.tpl: Dito.
	* Makefile.in: Regenerate.

gcc/c/:

2016-06-23  Andi Kleen  <[email protected]>

	* Make-lang.in: Add support for autofdo.

From-SVN: r237733
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Jun 23, 2016
1 parent 7f586d9 commit 277d7ee
Show file tree
Hide file tree
Showing 13 changed files with 5,713 additions and 175 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2016-06-23 Andi Kleen <[email protected]>

* Makefile.def: Add autoprofiledbootstrap.
* Makefile.tpl: Dito.
* Makefile.in: Regenerate.

2016-06-23 Jakub Sejdak <[email protected]>

* configure.ac: Disable libgcj and libgloss for Phoenix-RTOS targets.
Expand Down
7 changes: 7 additions & 0 deletions Makefile.def
Original file line number Diff line number Diff line change
Expand Up @@ -639,3 +639,10 @@ bootstrap_stage = {
bootstrap_stage = {
id=feedback ; prev=profile ;
bootstrap_target=profiledbootstrap ; };
bootstrap_stage = {
id=autoprofile ; prev=1 ;
autoprofile="$$s/gcc/config/i386/$(AUTO_PROFILE)" ; };
bootstrap_stage = {
id=autofeedback ; prev=autoprofile ;
bootstrap_target=autoprofiledbootstrap ;
profile_data="PERF_DATA=perf.data" ; };
Loading

0 comments on commit 277d7ee

Please sign in to comment.