This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More realistic alignment decisions


On 10/7/07, Jan Hubicka <jh@suse.cz> wrote:
>
> Hi,
> 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
> fallthru.
>
> 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.
>
> OK?

Ok, thanks,

Richard.

> Honza
>         * 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]