Move rest_of_handle_ branch)prob before GCSE
Qiong Cai
qiongc@cse.unsw.edu.au
Tue Feb 10 03:53:00 GMT 2004
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
More information about the Gcc
mailing list