diff mbox

[HSA] Enhance dump output

Message ID 56EFD78B.3010707@suse.cz
State New
Headers show

Commit Message

Martin Liška March 21, 2016, 11:14 a.m. UTC
Hello.

Following patch enhances dump output for SBR instructions and
provides a BRIG offset of HSA symbols. The change does not touch any
code generation snippet and I hope it can be installed during the stage4?

Patch can bootstrap on x86_64-linux-gnu and survives
make check-target-libgomp.

Ready for trunk?
Thanks,
Martin

Comments

Martin Jambor March 21, 2016, 5:44 p.m. UTC | #1
Hi,

On Mon, Mar 21, 2016 at 12:14:19PM +0100, Martin Liska wrote:
> Hello.
> 
> Following patch enhances dump output for SBR instructions and
> provides a BRIG offset of HSA symbols. The change does not touch any
> code generation snippet and I hope it can be installed during the stage4?

yes, but...

> 
> Patch can bootstrap on x86_64-linux-gnu and survives
> make check-target-libgomp.
> 
> Ready for trunk?
> Thanks,
> Martin

> From f59542322d584a1c61bfbd0148c90671a89d0593 Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Tue, 15 Mar 2016 11:57:30 +0100
> Subject: [PATCH] HSA: enhance dump output
> 
> gcc/ChangeLog:
> 
> 2016-03-15  Martin Liska  <mliska@suse.cz>
> 
> 	* hsa-dump.c (dump_hsa_insn_1): dump default branch of SBR
> 	insns.
> 	(dump_hsa_symbol): Dump BRIG offset of hsa_symbols.
> ---
>  gcc/hsa-dump.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/hsa-dump.c b/gcc/hsa-dump.c
> index c5f1f69..ad0c8bf 100644
> --- a/gcc/hsa-dump.c
> +++ b/gcc/hsa-dump.c
> @@ -721,6 +721,10 @@ dump_hsa_symbol (FILE *f, hsa_symbol *symbol)
>  
>    if (symbol->m_type & BRIG_TYPE_ARRAY_MASK)
>      fprintf (f, "[%lu]", (unsigned long) symbol->m_dim);
> +
> +

...please remove the added newlines here...

> +  if (symbol->m_directive_offset)
> +    fprintf (f, "             /* BRIG offset: %u", symbol->m_directive_offset);

...and I think you are missing an ending "*/" in the string you dump.

>  }
>  
>  /* Dump textual representation of HSA IL operand OP to file F.  */
> @@ -929,7 +933,8 @@ dump_hsa_insn_1 (FILE *f, hsa_insn_basic *insn, int *indent)
>  	    fprintf (f, ", ");
>  	}
>  
> -      fprintf (f, "]");
> +      fprintf (f, "] /* default: BB %i */",
> +	       hsa_bb_for_bb (sbr->m_default_bb)->m_index);

I think I've approved this already?

Thanks,

Martin
Martin Liška March 21, 2016, 7:39 p.m. UTC | #2
On 03/21/2016 06:44 PM, Martin Jambor wrote:
> ...please remove the added newlines here...
>
>> >+  if (symbol->m_directive_offset)
>> >+    fprintf (f, "             /* BRIG offset: %u", symbol->m_directive_offset);
> ...and I think you are missing an ending "*/" in the string you dump.
>

Sure, fixed.

>> >  }
>> >
>> >  /* Dump textual representation of HSA IL operand OP to file F.  */
>> >@@ -929,7 +933,8 @@ dump_hsa_insn_1 (FILE *f, hsa_insn_basic *insn, int *indent)
>> >  	    fprintf (f, ", ");
>> >  	}
>> >
>> >-      fprintf (f, "]");
>> >+      fprintf (f, "] /* default: BB %i */",
>> >+	       hsa_bb_for_bb (sbr->m_default_bb)->m_index);
> I think I've approved this already?

Yeah, but it was probably just a private email I sent.
Installed as r234379.

Thanks,
Martin

>
> Thanks,
>
> Martin
>
diff mbox

Patch

From f59542322d584a1c61bfbd0148c90671a89d0593 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 15 Mar 2016 11:57:30 +0100
Subject: [PATCH] HSA: enhance dump output

gcc/ChangeLog:

2016-03-15  Martin Liska  <mliska@suse.cz>

	* hsa-dump.c (dump_hsa_insn_1): dump default branch of SBR
	insns.
	(dump_hsa_symbol): Dump BRIG offset of hsa_symbols.
---
 gcc/hsa-dump.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/hsa-dump.c b/gcc/hsa-dump.c
index c5f1f69..ad0c8bf 100644
--- a/gcc/hsa-dump.c
+++ b/gcc/hsa-dump.c
@@ -721,6 +721,10 @@  dump_hsa_symbol (FILE *f, hsa_symbol *symbol)
 
   if (symbol->m_type & BRIG_TYPE_ARRAY_MASK)
     fprintf (f, "[%lu]", (unsigned long) symbol->m_dim);
+
+
+  if (symbol->m_directive_offset)
+    fprintf (f, "             /* BRIG offset: %u", symbol->m_directive_offset);
 }
 
 /* Dump textual representation of HSA IL operand OP to file F.  */
@@ -929,7 +933,8 @@  dump_hsa_insn_1 (FILE *f, hsa_insn_basic *insn, int *indent)
 	    fprintf (f, ", ");
 	}
 
-      fprintf (f, "]");
+      fprintf (f, "] /* default: BB %i */",
+	       hsa_bb_for_bb (sbr->m_default_bb)->m_index);
     }
   else if (is_a <hsa_insn_arg_block *> (insn))
     {
-- 
2.7.1