Go: cmd/compile: delete the legacy compiler back end

Created on 13 Jul 2016  Â·  32Comments  Â·  Source: golang/go

When all the SSA backends are done, delete the legacy compiler.

This is basically a tracking bug for the work on all the SSA backends.

amd64 - done
arm - #15365
arm64 - #16009
ppc64 - #16010 #16175

FrozenDueToAge

Most helpful comment

arm64 is done.

All 32 comments

386 - #16358

mips64, @cherrymui ?

MIPS64- #16359

amd64p32 is now using the SSA backend.

https://go-review.googlesource.com/c/25586/

386 (including GO386=387) is now using the SSA backend.

ARM is done.

MIPS64 is done.

All that is left is s390x and ppc64(be).

ppc64be lacks only a test machine.
Last time it was tested, it worked, or so I hear.

On Fri, Aug 26, 2016 at 4:51 PM, Keith Randall [email protected]
wrote:

MIPS64 is done.

All that is left is s390x and ppc64(be).

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/golang/go/issues/16357#issuecomment-242848247, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AB1vJ4p97fG7FUUW5Ww24JH4c5n0oeUkks5qj1HLgaJpZM4JLvsd
.

working on s390x

arm64 is done.

s390x is done #16677
We now have the greenlight to start deleting the legacy compiler.
Any suggestions on how to do the equivalent of GOSSAHASH when there is no longer a legacy compiler are welcome.

@randall77, could GOSSAHASH remain but instead of using the old backend, mean to disable optimizations (like -N)?

That would work if you're hacking on an SSA pass that is disabled with -N. That covers some cases but not all.
I want something like "clone the cmd/compile/internal/ssa package. Develop a CL on one of them. Use GOSSAHASH to decide per-function whether to use the orignal or the modified version".
Maybe include cmd/compile/internal/gc/ssa.go and cmd/compile/internal/ARCH/ssa.go in that clone/swap process.

How about a top level flag (-hash=) and a support function (func hashmatch(name string) bool) that reports whether it matches. Then you can conditionally enable/disable any chunk of code you want, anywhere in the compiler.

An individual phase would be pretty easy to hack in by hand, yes.
You just have to duplicate the code in question and add a flag check. It gets daunting when your change is across 3 packages.

I've done Josh's method before, and I'm pretty happy with that method.
Some way of doing it wholesale old/new would be more than a little interesting.

Back to the exciting topic of deleting the old backend, Keith, it seems to me you should have the honor of doing the first big del, if you want it.

Another, much more complicated GOSSAHASH idea: Teach the linker to be able to combine two sources of object files. Using the known good compiler, compile everything and stash the object files. At link time, use GOSSAHASH to merge them. Wrap up behind a tool, maybe via -toolexec?

Sounds complicated, but maybe that's ok...or maybe it'll inspire a better idea in someone else.

I am licking my lips.

On Tue, Sep 13, 2016 at 1:52 PM, Josh Bleecher Snyder <
[email protected]> wrote:

Back to the exciting topic of deleting the old backend, Keith, it seems to
me you should have the honor of doing the first big del, if you want it.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/golang/go/issues/16357#issuecomment-246820040, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGkgIDR1ieJsp6xBnmCKp9h35xlfsMROks5qpw0dgaJpZM4JLvsd
.

Given that we export all the phases as function pointers, this sort of old/new switchiness is perhaps not that magical. We might want to be more disciplined in our connections between gc/ssa.go and the ssa package.

I like Josh's idea. Kind of like a per-function toolstash. A hacky Go
program that takes two pkg directories and merges each .o/.a using hashes
of the function names to decide which one to take.

On Tue, Sep 13, 2016 at 2:00 PM, dr2chase [email protected] wrote:

Given that we export all the phases as function pointers, this sort of
old/new switchiness is perhaps not that magical. We might want to be more
disciplined in our connections between gc/ssa.go and the ssa package.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/golang/go/issues/16357#issuecomment-246822287, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGkgIKxnfZYjtqspnk5Dpsd6ved-lgXWks5qpw7QgaJpZM4JLvsd
.

Ah, I misunderstood. Is that going to be easy/possible to embed within make.bash or go test?

Ah, I misunderstood. Is that going to be easy/possible to embed within make.bash or go test?

You would presumably write a wrapper, like what buildall does for toolstash -cmp.

CL https://golang.org/cl/29168 mentions this issue.

Should I start including and suggesting others to add "Updates #16357" to cleanup CLs related to this?

Yes, can't hurt.

On Fri, Sep 16, 2016 at 10:44 AM, Matthew Dempsky [email protected]
wrote:

Should I start including and suggesting others to add "Updates #16357
https://github.com/golang/go/issues/16357" to cleanup CLs related to
this?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/golang/go/issues/16357#issuecomment-247662542, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGkgIEe62Rip0btCljPzVpoPNfcNBnxBks5qqtVjgaJpZM4JLvsd
.

Roger roger.

CL https://golang.org/cl/29350 mentions this issue.

CL https://golang.org/cl/29219 mentions this issue.

Declaring this done.

Was this page helpful?
0 / 5 - 0 ratings