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] Run DCE after if conversion


On Tue, Mar 10, 2015 at 8:57 AM, Andreas Krebbel wrote:
>
>         * gcc/ifcvt.c (if_convert):
>

...yes...?


> diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
> index a3e3e5c..d2040af 100644
> --- a/gcc/ifcvt.c
> +++ b/gcc/ifcvt.c
> @@ -4626,6 +4626,13 @@ if_convert (bool after_combine)
>                num_true_changes);
>      }
>
> +  if (num_true_changes > 0)
> +    {
> +      df_set_flags (DF_LR_RUN_DCE);
> +      df_mark_solutions_dirty ();
> +      df_analyze ();
> +    }
> +
>   if (optimize == 1)
>     df_remove_problem (df_live);

Tiny nail, huge hammer. This triggers a full re-scan of all insns and
a re-calculation of all dataflow problems.

The transformations in ifcvt are all simple enough that it should be
possible to just clean up that redundant insn at the site where the
code transformation is performed.

Ciao!
Steven


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