pro64-support
[Top] [All Lists]

Re: A question on feedback in the Pro64

To: dxq <dxq@xxxxxxxxx>, pro64-support@xxxxxxxxxxx
Subject: Re: A question on feedback in the Pro64
From: David Stephenson <dlstephe@xxxxxxx>
Date: Thu, 19 Apr 2001 21:31:56 -0700
Cc: "A. Cameron Macdonell" <cam@xxxxxxxxxxxxxx>
Organization: SGI -- Compilers
References: <Pine.LNX.4.21.0103201442170.7655-100000@xxxxxxxxxxxxxxxxxxxxx> <001601c0c943$b910c650$2a0379c8@DXQ>
Sender: owner-pro64-support@xxxxxxxxxxx
dxq wrote:

> If you want to enable dynamic profile which has feedback,you
> should compile as next steps:
>   1) sgicc -fb_create feed_back_file matrix.c  (do
>      instrumentation work)
>   2)a.out ( I don't know whether your program read the input
>      file itself, if it can't, you should manually send the
>      input to a.out)
>   3) sgicc -fb feed_back_file matrix.c (read feedback info
>      and annotation)
>   4) a.out

Use -fb_opt instead of -fb in stage 3.

>  but the older version Pro64 did't have a lib "libinstr.so",
> it is said that the newest version Pro64 publish the lib.

Correct.  The source for libinstr.so was released with version
0.13 but not 0.12.

>   In  driver.cxx , the function WN_Annotate is used to read
> the feedback and annotation. There are transforms and
> optimizations, so in hyperblock formation phase, the edge freq
> maybe is not the true frequency.

To clarify: Both instrumentation and annotation are performed
in be just before lowering from VH WHIRL to H WHIRL.  At this
point, the annotated frequencies are exact counts.  After this
point, the compiler will continue running the other backend
phases, and perform some code transformations.  Transformations
that affect control flow require that the frequency data be
updated to reflect the change.  In a few cases (primarily
transformation that involve code cloning, such as inlining) the
frequencies cannot be exactly updated; educated guesses are
made instead.  Consequently, when the compiler reaches code
generation phase (including hyperblock formation), some of the
frequencies may not represent exact known counts from the
training run.  Limited experimental evidence suggests that this
doesn't have much impact on performance.

>   BTW: In now Pro64 edge does not have not freq info, but has
> probability info. basic block has freq info and does not have
> prob info.

Within the code generator phase, all blocks are assigned
frequencies counts (normalized to 1 at the procedure entry)
and branches are assigned probabilities.  These frequencies are
assigned using heuristics if feedback data is not available.
Other phases of the compiler only have frequency data available
if compiled with -fb_opt.  Except in the code generator,
frequencies are stored in the FEEDBACK class, using frequency
values of type FB_FREQ.

                                                - David

<Prev in Thread] Current Thread [Next in Thread>