fix opt/8634

Geoff Keating geoffk@geoffk.org
Wed Apr 9 23:16:00 GMT 2003


Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> writes:

> It would also make a sense
> to have less memory bloated code representation (but this is of course
> something that cannot be changed now, and also it does not seem
> quite desirable).

It can be changed.  I can't find it now, but some time ago I wrote a
mail message to the GCC lists explaining how you could do everything
that GCC does now with RTL by using data structures that are tied to
specific machine instructions; for instance, instead of having

(jump_insn 178 177 325 (set (pc)
        (if_then_else (ne (reg:CC 150)
                (const_int 0 [0x0]))
            (label_ref 231)
            (pc))) 541 {*rs6000.md:13889} (nil)
    (expr_list:REG_DEAD (reg:CC 150)
        (nil)))

you have

(jump_insn 178 177 325 541 {*rs6000.md:13889} (reg:CC 150) (label_ref 231)
  (nil) 
  (expr_list:REG_DEAD (reg:CC 150) (nil)) 
 )

which can be even further simplified if you notice that the first
parameter will always be a REG and the second a label_ref.  The
biggest win is not even in memory consumption, although that's pretty
big, it's that you don't have to traverse over all the pointers; you
can look at everything in this insn, other than the notes, without any
pointer dereferences at all.

-- 
- Geoffrey Keating <geoffk@geoffk.org>



More information about the Gcc-patches mailing list