Jakub Jelinek <ja...@redhat.com> writes:
> On Tue, Feb 16, 2021 at 09:16:40AM +0000, Richard Sandiford wrote:
>> But doing it on demand like this seems fragile.  And the targets aren't
>> a fixed… target.  I think we need to design the interface so that things
>> are unlikely to go wrong in future rather than design it on the basis
>> that things will stay the way they are now.
>
> By making it possible but not required to use df in split passes, at least
> if we document it, I don't see why it should be fragile.
>
> In order to benchmark it, I've tried to do release checking build without
> and with the following patch.  Except with the patch bootstrap fails
> miserably, df_analyze in split1 pass doesn't work at -O0 at all.

I assume that's because pass_df_initialize_no_opt is slightly after
the first pass_split_all_insns?  Seems like it should just be a case
of moving it up.

> And for noflow where the cfg doesn't really exit I wouldn't even attempt to
> do df_analyze.

What stops ix86_ok_to_clobber_flags being called in that case?

Thanks,
Richard

> Plus many backends just call split_all_insns on their own
> at various places...
>
> diff --git a/gcc/recog.c b/gcc/recog.c
> index abbc49f3f9b..e960d4ba706 100644
> --- a/gcc/recog.c
> +++ b/gcc/recog.c
> @@ -4380,8 +4380,9 @@ public:
>    opt_pass * clone () { return new pass_split_all_insns (m_ctxt); }
>    virtual unsigned int execute (function *)
>      {
> +      df_analyze ();
>        split_all_insns ();
> -      return 0;
> +      return TODO_df_finish;
>      }
>  
>  }; // class pass_split_all_insns
> @@ -4425,8 +4426,9 @@ public:
>  
>    virtual unsigned int execute (function *)
>      {
> +      df_analyze ();
>        split_all_insns ();
> -      return 0;
> +      return TODO_df_finish;
>      }
>  
>  }; // class pass_split_after_reload
> @@ -4479,8 +4481,9 @@ public:
>  
>    virtual unsigned int execute (function *)
>      {
> +      df_analyze ();
>        split_all_insns ();
> -      return 0;
> +      return TODO_df_finish;
>      }
>  
>  }; // class pass_split_before_sched2
> @@ -4519,8 +4522,9 @@ public:
>    virtual bool gate (function *);
>    virtual unsigned int execute (function *)
>      {
> +      df_analyze ();
>        split_all_insns ();
> -      return 0;
> +      return TODO_df_finish;
>      }
>  
>  }; // class pass_split_before_regstack
>
>
>       Jakub

Reply via email to