This is the mail archive of the gcc-help@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]

Question about -fbranch-probabilities


Hi !

I'm David Bruant, I'm french, so sorry if my english is not perfect.
Here is my problem
On the manual chap 3 page 99 (111 of the pdf document), there are
explanations about -fbranch-probabilities :

"After running a program compiled with â-fprofile-arcsâ (see Section 3.9
[Options for Debugging Your Program or gcc], page 63), you can compile
it a second time using â-fbranch-probabilitiesâ, to improve
optimizations based on the number of times each branch was taken. When
the program compiled with â-fprofile-arcsâ exits it saves arc execution
counts to a file called âsourcename.gcdaâ for each source file. The
information in this data file is very dependent on the structure of the
generated code, so you must use the same source code and the same
optimization options for both compilations."

And I've got a problem with the "When the program compiled with
â-fprofile-arcsâ exits" because I am running a backtrack algorithm which
is not going to exit before the end of the universe, but I would be
interested to have a (very) good solution (or at least the beginning of
one) of my problem before my death, that's why I would like to improve
its speed thanks to -profile-arcs and -fbranch-probabilities.

I have had an idea which would be to force the end of the algorithm
thanks to a variable which would end it after 2 hours (for example).
This way, -fprofile-arcs would have a wide enough sample to improve with
-fbranch-probabilities, but the "you must use the same source code"
frightens me because if I add a variable to measure time, it's obviously
not the same source code.
So, could anyone tell me more about the restrictions of -fprofile-arcs
and if my idea is a good one ?

Thanks

David Bruant


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