This is the mail archive of the gcc-patches@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: [patch] Move switch-conversion after profiling


On Thu, Apr 19, 2012 at 5:16 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> Hello,
>
> If we want to use profiling to expand switches in GIMPLE, we'll have
> to run switch-conversion after profiling.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu. OK?

That's too early still.  Profile data is not read until pass_ipa_tree_profile.
Which means moving it to after all IPA transforms (and thus run at LTRANS
stage with LTO) would be better.  May I suggest to move it after the
DCE pass that runs after the first VRP pass?

Thanks,
Richard.

> Ciao!
> Steven
>
> ? ? ? ?* passes.c (pass_convert_switch): Move after profiling and pure_const.
>
> Index: passes.c
> ===================================================================
> --- passes.c ? ?(revision 186586)
> +++ passes.c ? ?(working copy)
> @@ -1326,10 +1326,10 @@ init_optimization_passes (void)
> ? ? ? ? ?NEXT_PASS (pass_cd_dce);
> ? ? ? ? ?NEXT_PASS (pass_early_ipa_sra);
> ? ? ? ? ?NEXT_PASS (pass_tail_recursion);
> - ? ? ? ? NEXT_PASS (pass_convert_switch);
> ? ? ? ? ? NEXT_PASS (pass_cleanup_eh);
> ? ? ? ? ? NEXT_PASS (pass_profile);
> ? ? ? ? ? NEXT_PASS (pass_local_pure_const);
> + ? ? ? ? NEXT_PASS (pass_convert_switch);
> ? ? ? ? ?/* Split functions creates parts that are not run through
> ? ? ? ? ? ? early optimizations again. ?It is thus good idea to do this
> ? ? ? ? ? ? late. ?*/


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