This is the mail archive of the 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: ra-debug.c: why?


First: I implemented the format so my brain pain is reduced to a minimum
when analyzing dumps of functions of the size of 10000 insns.  The
traditional RTL dump as used in ra*.c would make the dump itself around
150Mb.  Others might be comfortable with seeing only six or seven insns
per 35 line page, I'm not.  Or they might be comfortable with the
convoluted syntax of lisp style.  But I definetely prefer seeing

  4     p59 <= [(h16 + 4)]:DF

compared with

(insn:HI 4 3 5 0 (nil) (set (reg/v:DF 59)
        (mem/f:DF (plus:SI (reg/f:SI 16 argp)
                (const_int 4 [0x4])) [3 b+0 S8 A64])) 94 {*movdf_nointeger} (nil)

On Wed, 17 Jul 2002, Zack Weinberg wrote:

> irrelevant.  However, the implementation stinks, for two reasons:
> 1) It was done by duplicating most of print-rtl.c and then tweaking it
>    around.

Not at all.  print-rtl more or less simply is a recursive lisp dumper.
ra-debug OTOH prints RTL depending on the actual GET_CODE().  This means,
that simple enough changes (adding of a new code) in RTL do not need
changes in print-rtl, but definitely in ra-debug (if one doesn't want to
use it's fallback to print-rtl).

> This is asking for trouble down the road, as people make changes to
> RTL.  We already have too damn much near-duplicate code; don't make it
> worse.

I claim there is no dode duplication between print-rtl and ra-debug in the
actual RTL printing.  For the higher lever functions like debug_insns() I

>    makes it much harder to keep straight what's going on.  And, as I
>    said, it is now impossible to do diffs between the .22.lreg dump
>    and any other.

It's anyway quite worthless, even if ra* would use print_rtl_with_bb,
because the allocator dumps all RTL after each pass of allocation, not
just the final result.  And even if it wouldn't, the diff would
nevertheless be worthless, because the allocator changes _all_ pseudos to
different numbers, i.e. the diff would include most insns.  That being
said, I might add a switch to use the traditional RTL dumping also in the
allocator if this makes you happy.

> It would be much better if print-rtl.c were parametrized to generate
> both dump formats, and if this were controlled by a global option.

I agree.  But look closer at the structure of print_rtx() and
ra_print_rtx*(), and the difference in needs for printing (a + b)
or (+ a b).  I fear print-rtl in it's current form would not be able to
print RTL as I like it.


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