This is the mail archive of the
mailing list for the GCC project.
Re: More realistic alignment decisions
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Jan Hubicka" <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 8 Oct 2007 11:07:53 +0200
- Subject: Re: More realistic alignment decisions
- References: <20071007084704.GG2688@kam.mff.cuni.cz>
On 10/7/07, Jan Hubicka <email@example.com> wrote:
> Kenny run into problem where internal loop wasn't aligned as expected.
> The current algorithm for alignment is based on profile and it is a bit dificult
> to analyze what is going on, since debug info is not dumped and algorithm
> can be misguided by mismatched profile.
> This patch implements dumping facility that also builds loop structure so
> one can see if profile is still matching a reality (sort of) and while
> looking at the dumps I noticed problems that blocks get aligned only if they
> are executed not less than 10 times less often than most hot block in function
> and loop was detected as blocks reached twice as often via loopback then via
> This was done so since initially we was predicting very flat profiles with loop
> containing more than one exit predicted to exectue twice or three times. We
> now do more realistic estimate so this can be made more sharp - I changed first
> constant to 100 and second to 4. Benchmarking it on Itanium and x86-64 there
> is no difference on Itanium and about 10 point gain on x86-64 SPEC that is
> pretty consistent.
> Patch also turns those two constants into parameters.
> * invoke.texi (align-threshold, align-loop-iterations): Document.
> * final.c: Include cfgloop.h, params.h
> (compute_alignments): Dump decisions and compare them with loop
> structure; honor given parameters.
> (pass_compute_alignments): New dump file.
> * params.def (PARAM_ALIGN_THRESHOLD, PARAM_ALIGN_LOOP_ITERATIONS): New.