rs6000: skip debug info statements

Message ID 465202ab-c977-2f04-8501-1d26690d6c89@suse.cz
State New
Headers show
Series
  • rs6000: skip debug info statements
Related show

Commit Message

Martin Liška June 11, 2020, 11:49 a.m.
Hi.

Since stmt_vec_info is not generated for debug info statements, these needs to
be skipped in rs6000_density_test.

Patch can bootstrap on ppc64le-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

	PR target/95627
	* config/rs6000/rs6000.c (rs6000_density_test): Skip debug
	statements.
---
  gcc/config/rs6000/rs6000.c | 3 +++
  1 file changed, 3 insertions(+)

-- 
2.26.2

Comments

xionghu luo via Gcc-patches June 11, 2020, 12:46 p.m. | #1
On June 11, 2020 1:49:57 PM GMT+02:00, "Martin Liška" <mliska@suse.cz> wrote:
>Hi.

>

>Since stmt_vec_info is not generated for debug info statements, these

>needs to

>be skipped in rs6000_density_test.

>

>Patch can bootstrap on ppc64le-linux-gnu and survives regression tests.

>

>Ready to be installed?


OK. 

Richard. 

>Thanks,

>Martin

>

>gcc/ChangeLog:

>

>	PR target/95627

>	* config/rs6000/rs6000.c (rs6000_density_test): Skip debug

>	statements.

>---

>  gcc/config/rs6000/rs6000.c | 3 +++

>  1 file changed, 3 insertions(+)

>

>diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c

>index 0bbd06ad1de..00daf979856 100644

>--- a/gcc/config/rs6000/rs6000.c

>+++ b/gcc/config/rs6000/rs6000.c

>@@ -4987,6 +4987,9 @@ rs6000_density_test (rs6000_cost_data *data)

>       for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))

>  	{

>  	  gimple *stmt = gsi_stmt (gsi);

>+	  if (is_gimple_debug (stmt))

>+	      continue;

>+

>  	  stmt_vec_info stmt_info = loop_vinfo->lookup_stmt (stmt);

>  

>  	  if (!STMT_VINFO_RELEVANT_P (stmt_info)
xionghu luo via Gcc-patches June 11, 2020, 12:56 p.m. | #2
On Thu, Jun 11, 2020 at 01:49:57PM +0200, Martin Liška wrote:
> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c

> index 0bbd06ad1de..00daf979856 100644

> --- a/gcc/config/rs6000/rs6000.c

> +++ b/gcc/config/rs6000/rs6000.c

> @@ -4987,6 +4987,9 @@ rs6000_density_test (rs6000_cost_data *data)

>        for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))

>  	{

>  	  gimple *stmt = gsi_stmt (gsi);

> +	  if (is_gimple_debug (stmt))

> +	      continue;


Formatting, continue; indented too much.

	Jakub
Segher Boessenkool June 11, 2020, 7:04 p.m. | #3
Hi!

On Thu, Jun 11, 2020 at 01:49:57PM +0200, Martin Liška wrote:
> Since stmt_vec_info is not generated for debug info statements, these needs 

> to

> be skipped in rs6000_density_test.


> 	PR target/95627

> 	* config/rs6000/rs6000.c (rs6000_density_test): Skip debug

> 	statements.


> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c

> index 0bbd06ad1de..00daf979856 100644

> --- a/gcc/config/rs6000/rs6000.c

> +++ b/gcc/config/rs6000/rs6000.c

> @@ -4987,6 +4987,9 @@ rs6000_density_test (rs6000_cost_data *data)

>        for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))

>  	{

>  	  gimple *stmt = gsi_stmt (gsi);

> +	  if (is_gimple_debug (stmt))

> +	      continue;


Yes, this is fine for trunk (with the indent fixed), thanks!

Or you could use gsi_next_nondebug?  That is a bit neater.  Either way
is okay.

Thanks!


Segher
xionghu luo via Gcc-patches June 12, 2020, 8:39 a.m. | #4
On Thu, Jun 11, 2020 at 9:04 PM Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>

> Hi!

>

> On Thu, Jun 11, 2020 at 01:49:57PM +0200, Martin Liška wrote:

> > Since stmt_vec_info is not generated for debug info statements, these needs

> > to

> > be skipped in rs6000_density_test.

>

> >       PR target/95627

> >       * config/rs6000/rs6000.c (rs6000_density_test): Skip debug

> >       statements.

>

> > diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c

> > index 0bbd06ad1de..00daf979856 100644

> > --- a/gcc/config/rs6000/rs6000.c

> > +++ b/gcc/config/rs6000/rs6000.c

> > @@ -4987,6 +4987,9 @@ rs6000_density_test (rs6000_cost_data *data)

> >        for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))

> >       {

> >         gimple *stmt = gsi_stmt (gsi);

> > +       if (is_gimple_debug (stmt))

> > +           continue;

>

> Yes, this is fine for trunk (with the indent fixed), thanks!

>

> Or you could use gsi_next_nondebug?  That is a bit neater.  Either way

> is okay.


Also need to adjust gsi_start_bb then, of course.

>

> Thanks!

>

>

> Segher

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 0bbd06ad1de..00daf979856 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4987,6 +4987,9 @@  rs6000_density_test (rs6000_cost_data *data)
        for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
  	{
  	  gimple *stmt = gsi_stmt (gsi);
+	  if (is_gimple_debug (stmt))
+	      continue;
+
  	  stmt_vec_info stmt_info = loop_vinfo->lookup_stmt (stmt);
  
  	  if (!STMT_VINFO_RELEVANT_P (stmt_info)