[dev.ssa] cmd/internal/ssa: Handle more instructions + some cleanup

Add & as an input op.  Add several output ops (loads & stores, TESTB,
LEAQglobal, branches, memcopy)

Some other small things:
- Add exprAddr to builder to generate addresses of expressions.  Use it in
  various places that had ad-hoc code.
- Separate out nil & bounds check generation to separate functions.
- Add explicit FP and SP ops so we dont need specialized *FP and *SP opcodes.
- Fix fallthrough at end of functions with no return values.
- rematerialization of more opcodes.

Change-Id: I781decfcef9770fb15f0cd6b061547f7824a2d5e
Reviewed-on: https://go-review.googlesource.com/10213
Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Keith Randall 2015-05-18 16:44:20 -07:00
parent 083a646f63
commit cfc2aa56b0
16 changed files with 926 additions and 524 deletions

View file

@ -15,6 +15,9 @@ func stackalloc(f *Func) {
if v.Op != OpPhi {
continue
}
if v.Type.IsMemory() { // TODO: only "regallocable" types
continue
}
n += v.Type.Size()
// a := v.Type.Align()
// n = (n + a - 1) / a * a TODO
@ -35,10 +38,11 @@ func stackalloc(f *Func) {
if v.Type.IsMemory() { // TODO: only "regallocable" types
continue
}
if v.Op == OpConst {
// don't allocate space for OpConsts. They should
// have been rematerialized everywhere.
// TODO: is this the right thing to do?
if len(v.Args) == 0 {
// v will have been materialized wherever it is needed.
continue
}
if len(v.Args) == 1 && (v.Args[0].Op == OpFP || v.Args[0].Op == OpSP || v.Args[0].Op == OpGlobal) {
continue
}
// a := v.Type.Align()