This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Basic block counts?
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Jan Hoogerbrugge <hoogerbrugge at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 18 Feb 2004 13:08:03 -0800
- Subject: Re: Basic block counts?
- References: <BAY9-F48RljFtZf09o50003fab5@hotmail.com>
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