mirror of
https://github.com/golang/go.git
synced 2025-05-21 15:24:21 +00:00
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: Keith Randall <khr@golang.org>
This commit is contained in:
parent
862fde81fc
commit
a6b3331236
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user