tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Removing ARCNET stuffs



Andrew Cagney skrev den 2015-06-08 19:18:
I'm clearly out-of-date regarding SSA, its nice to be corrected.
No problem :-)

On 8 June 2015 at 09:06, Anders Magnusson <ragge%ludd.ltu.se@localhost> wrote:
Andrew Cagney skrev den 2015-06-01 20:41:
I do not understand why either of those choices need to be taken.
Pcc has a reasonable intermediate representation, which in the optimizer
is converted to SSA form, hammered on, and converted back.  This is
done while retaining the intermediate representation, which is no problem.
I'm being fast and loose.  My reading of the code was that debug info
was being generated by the back of the front end (very roughly
"gimplify" in this diagram of GCC
https://gcc.gnu.org/projects/tree-ssa/#ssa).   It was pretty much hard
wired printfs, and explained to me why "-g -O" wasn't supported.
printf's are only used for data (which is spit out directly), not code.
All code is dealt with function-wise, otherwise things like the register
allocator would not work.

Unless, I guess, what you're talking about is throwing away the
existing backend entirely and writing a new SSA-based one, in which
case I'd gently suggest that this is a large project :-)
Exactly :-(

What is wrong with the existing backend?
As you state, the representation gets taken into and then out of SSA.
Why bother; at least for the converting to-ssa side?

The rest of the compiler works on the (quite simple) internal representation
which is very easy to deal with. The SSA conversion code is only a minor part of the compiler backend (and somewhat complex) so it is better to keep it separate. Also, going directly to SSA in pass1 would require all different language frontends to
have knowledge about it, which is unneccessary.

Basic steps in the backend are:
- Delete redundant jumps (simplifies SSA)
- SSA conversion,  (optim), remove phi nodes
- Assign instructions
- Allocate registers
- Emit code

Turning off optimizations basically just skips the first two steps :-)

-- Ragge


Home | Main Index | Thread Index | Old Index