On Wed, Apr 22, 2020 at 11:58:38AM +0200, Richard Biener wrote:
> On Wed, Apr 22, 2020 at 11:26 AM Richard Sandiford
> <richard.sandif...@arm.com> wrote:
> > Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> > > On Mon, Apr 20, 2020 at 3:38 PM Segher Boessenkool
> > > <seg...@kernel.crashing.org> wrote:
> > >> On Mon, Apr 20, 2020 at 09:56:34AM +0200, Richard Biener wrote:
> > >> > On Fri, Apr 17, 2020 at 10:51 PM Segher Boessenkool
> > >> > <seg...@kernel.crashing.org> wrote:
> > >> > > > Yeah well, but RTL is not in SSA form
> > >> > >
> > >> > > "Webs" are not the *same* as SSA, in a few crucial ways; but they 
> > >> > > serve
> > >> > > similar purposes: they both make code transformations easier to do.
> > >> > > Both do this by having more different (independent) names.
> > >> > >
> > >> > > > and there's no RTL IL verification
> > >> > > > in place to track degradation.
> > >> > >
> > >> > > Adding this isn't hard in principle.  But currently it is violated 
> > >> > > all
> > >> > > over the place, including in backend code.
> > >> >
> > >> > It's a cheap excuse and clearly a lot of work.  But we've done it for 
> > >> > GIMPLE
> > >> > and it was clearly worth it.  If only for documentation purposes.
> > >>
> > >> Yes, I very much agree :-)  But how will we do this?  Make it warnings
> > >> only, and have those opt-in (for a port) even?
> > >
> > > Add -fcheck-rtl, when you're ready (per port?) make it default for
> > > bootstrap.  When you're even more "ready", turn it on with -fchecking
> > > (or --enable-checking=xyz).
> >
> > What kind of condition would we be checking?  That no register has two
> > definitions in the same block?  Or something stronger?
> 
> For the particular discussion no idea.  But we generally lack
> verification of what is "valid" RTL and what is not.

There is RTL checking, and it works very well...  But "valid" just means
"structurally valid", and other very local things.  If we want to check
some extra properties, we actually have to make the rules for those
first!  :-)

> > In some ways it feels like it would be easier to resurrect RTL SSA :-)

Why was RTL SSA abandoned?

It might well work to keep everything in SSA form all the way to RA.
Hrm, that doesn't sound bad at all :-)

(The PHIs need to be made explicit to something that resembles the
machine code we will end up with, very early in the pipeline, but it
could still also be some valid SSA form; and we can of course also
have hard registers in all RTL, so that needs to be dealt with sanely
some way as well  Lots of details, I don't see a crucial problem though,
probably means I need to look harder ;-) )


Segher

Reply via email to