Commit a6b33312 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile/internal/gc: skip useless loads for non-SSA params

Change-Id: I78ca43a0f0a6a162a2ade1352e2facb29432d4ac
Reviewed-on: https://go-review.googlesource.com/37102
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent 862fde81
...@@ -120,19 +120,11 @@ func buildssa(fn *Node) *ssa.Func { ...@@ -120,19 +120,11 @@ func buildssa(fn *Node) *ssa.Func {
} }
} }
// Populate arguments. // Populate SSAable arguments.
for _, n := range fn.Func.Dcl { for _, n := range fn.Func.Dcl {
if n.Class != PPARAM { if n.Class == PPARAM && s.canSSA(n) {
continue s.vars[n] = s.newValue0A(ssa.OpArg, n.Type, n)
}
var v *ssa.Value
if s.canSSA(n) {
v = s.newValue0A(ssa.OpArg, n.Type, n)
} else {
// Not SSAable. Load it.
v = s.newValue2(ssa.OpLoad, n.Type, s.decladdrs[n], s.startmem)
} }
s.vars[n] = v
} }
// Convert the AST-based IR to the SSA-based IR // Convert the AST-based IR to the SSA-based IR
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment