Commit graph

2 commits

Author SHA1 Message Date
Keith Randall
d2fd43aa77 [dev.ssa] cmd/internal/gc: convert standard IR into SSA.
Hook into the current compiler to convert the existing
IR (after walk) into SSA.  Any function ending in "_ssa"
will take this path.  The resulting assembly is printed
and then discarded.

Use gc.Type directly in ssa instead of a wrapper for go types.
It makes the IR->SSA rewrite a lot simpler.

Only a few opcodes are implemented in this change.  It is
enough to compile simple examples like
    func f(p *int) int { return *p }
    func g(a []int, i int) int { return a[i] }

Change-Id: I5e18841b752a83ca0519aa1b2d36ef02ce1de6f9
Reviewed-on: https://go-review.googlesource.com/8971
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-04-16 22:31:05 +00:00
Keith Randall
f52b234579 [dev.ssa] cmd/internal/ssa: SSA backend compiler skeleton
First pass adding code for SSA backend.  It is standalone for now.
I've included just a few passes to make the review size manageable -
I have more passes coming.

cmd/internal/ssa is the library containing the ssa compiler proper.

cmd/internal/ssa/ssac is a driver that loads an sexpr-based IR,
converts it to SSA form, and calls the above library.  It is essentially
throwaway code - it will disappear once the Go compiler calls
cmd/internal/ssa itself.  The .goir files in ssac/ are dumps of fibonacci
programs I made from a hacked-up compiler.  They are just for testing.

Change-Id: I5ee89356ec12c87cd916681097cd3c2cd591040c
Reviewed-on: https://go-review.googlesource.com/6681
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-03-13 22:46:56 +00:00