This is the mail archive of the gcc@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: Basic block counts?


Jan Hoogerbrugge wrote:
Is it possible to obtain basic block counts (read by -fbranch-probabilities) in a define_insn
or via current_output_insn in print_operand?

Is it possible to obtain the total of all basic block counts so that I have an indication
of the contribution of a basic block to the execution time?

Look at the profiling code in profile.c.


Basic blocks have a count field that you can check. Instructions usually have a pointer to the block that contains them, so it seems like you should be able to access the count given an instruction. See BLOCK_FOR_INSN.

I don't know about total counts. It may be there somewhere. Try looking at the code.

The entry/exit basic block counts are useful, since they tell you how many times the function was executed. If the current block count is much larger than the function execution count, then it is an important block for this function.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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