diff mbox

[GOOGLE] recalculate dominance before update_ssa in AutoFDO pass

Message ID CAO2gOZW_XDXKPdhUVApMC+UKk5Cx+QBxw25DHJt2wGtyktZZmw@mail.gmail.com
State New
Headers show

Commit Message

Dehao Chen Oct. 15, 2014, 5:37 p.m. UTC
This patch recalculates dominance info before update_ssa call in
AutoFDO. This fixes bug when dominance info is out-of-date and causes
segfaults during update_ssa.

Bootstrapped and regression test on-going.

OK for google-4_9 branch?

Thanks,
Dehao

Comments

Xinliang David Li Oct. 15, 2014, 5:50 p.m. UTC | #1
Is it destroyed by value profile transformations? Can you move the
dominance recomputing code closer to where it gets invalidated?

David

On Wed, Oct 15, 2014 at 10:37 AM, Dehao Chen <dehao@google.com> wrote:
> This patch recalculates dominance info before update_ssa call in
> AutoFDO. This fixes bug when dominance info is out-of-date and causes
> segfaults during update_ssa.
>
> Bootstrapped and regression test on-going.
>
> OK for google-4_9 branch?
>
> Thanks,
> Dehao
>
> Index: gcc/auto-profile.c
> ===================================================================
> --- gcc/auto-profile.c (revision 216278)
> +++ gcc/auto-profile.c (working copy)
> @@ -1756,6 +1756,11 @@ auto_profile (void)
>        early_inline ();
>        autofdo::afdo_annotate_cfg (promoted_stmts);
>        compute_function_frequency ();
> +
> +      free_dominance_info (CDI_DOMINATORS);
> +      free_dominance_info (CDI_POST_DOMINATORS);
> +      calculate_dominance_info (CDI_POST_DOMINATORS);
> +      calculate_dominance_info (CDI_DOMINATORS);
>        update_ssa (TODO_update_ssa);
>
>        /* Local pure-const may imply need to fixup the cfg.  */
diff mbox

Patch

Index: gcc/auto-profile.c
===================================================================
--- gcc/auto-profile.c (revision 216278)
+++ gcc/auto-profile.c (working copy)
@@ -1756,6 +1756,11 @@  auto_profile (void)
       early_inline ();
       autofdo::afdo_annotate_cfg (promoted_stmts);
       compute_function_frequency ();
+
+      free_dominance_info (CDI_DOMINATORS);
+      free_dominance_info (CDI_POST_DOMINATORS);
+      calculate_dominance_info (CDI_POST_DOMINATORS);
+      calculate_dominance_info (CDI_DOMINATORS);
       update_ssa (TODO_update_ssa);

       /* Local pure-const may imply need to fixup the cfg.  */