This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Move rest_of_handle_ branch)prob before GCSE
- From: "Qiong Cai" <qiongc at cse dot unsw dot edu dot au>
- To: "Gcc" <gcc at gcc dot gnu dot org>
- Date: Tue, 10 Feb 2004 14:53:21 +1100
- Subject: Move rest_of_handle_ branch)prob before GCSE
- Organization: CSE, UNSW
- Reply-to: <qiongc at cse dot unsw dot edu dot au>
Hi,
Currently in toplev.c, the optimizations order is something like the
following:
... <= position A
[rest_of_handle_gcse]
[rest_of_handle_loop_optimize]
[rest_of_handle_jump_bypass]
[rest_of_handle_cfg]
[rest_of_handle_branch_prob] <= position B
....
Now, if I move branch_prob to position A before gcse , does this change
affect the optimizations after branch_prob?
>From the performance results, they are slight different.
The function "rest_of_handle_branch_prob" mainly contains two functions
"branch_prob" and "estimate_probability".
I think "branch_prob" has no effect for later optimizations (CFG is not
changed, only instrumenation/collection profiling), but
"estimate_probability" use the characteristic of CFG to determine the
probability, which may generate different probabilities at position A/B,
because the optimizations between A and B change the CFG. The
probabilities provided by "estimate_probability" are used by other later
optimizations such as "basic block reorder".
I'd like to know whether my explanation is correct or complete. Is there
any other reason the performance results are slightly different?
Thanks.
Qiong