Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #3530

Re: Interpreters and caller-saved registers

From anton@mips.complang.tuwien.ac.at
Newsgroups comp.compilers
Subject Re: Interpreters and caller-saved registers
Date 2023-10-19 17:14 +0000
Organization Compilers Central
Message-ID <23-10-003@comp.compilers> (permalink)
References <23-10-001@comp.compilers> <23-10-002@comp.compilers>

Show all headers | View raw


Thomas Koenig <tkoenig@netcologne.de> writes:
>It is well known that compilers in general and gcc specfically often
>generate superflous register moves
...
>However, if this got worse between releases, this is a regression.
>Those get higher priority for fixing.  So, if it is reasonable
>to generate a reduced test case (for which cvise, for example,
>is an excellent tool) so filing a bug report would be a good thing.

If you want to file such a bug report, I can give you the commit of
Gforth before we added all the workarounds, where all the problems
are visible without ado.

>This sort of code is an example of the contradictions in today's
>compiler technology.  On the one hand, they do amazing optimizations
>on large amounts of code which no programmer could hope to reach
>while staying productive.

There are certainly cases where compilers loop-unroll (plus
ramp-up/down and compensation code) code into huge swaths of code that
makes it hard to see where the action is going on, but amazing?

>So far, nobody has found an algorithm for "just remove the
>silliness" from compiled programs.  Maybe it would be feasible to
>run some peephole optimization as last passes which could improve
>code like the one above, but that might also be difficult in the
>more general case where registers are reused in other basic blocks
>(which would mean just to redo the register allocation).

Yes, I doubt that it can be solved with peephole optimization, or it
would have been done already.

- anton
--
M. Anton Ertl
anton@mips.complang.tuwien.ac.at
http://www.complang.tuwien.ac.at/anton/

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Interpreters and caller-saved registers anton@mips.complang.tuwien.ac.at - 2023-10-13 07:44 +0000
  Re: Interpreters and caller-saved registers Thomas Koenig <tkoenig@netcologne.de> - 2023-10-15 19:52 +0000
    Re: Interpreters and caller-saved registers anton@mips.complang.tuwien.ac.at - 2023-10-19 17:14 +0000
      Re: Interpreters and caller-saved registers Thomas Koenig <tkoenig@netcologne.de> - 2023-10-22 18:43 +0000
        Re: Interpreters and caller-saved registers anton@mips.complang.tuwien.ac.at - 2023-10-24 17:15 +0000
          Re: bug fixes, Interpreters and caller-saved registers Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-25 17:19 +0000

csiph-web