From: David Chase Date: Thu, 18 Oct 2018 18:43:51 +0000 (-0400) Subject: cmd/compile: schedule OpArg earlier in blocks for better debugging X-Git-Tag: go1.12beta1~669 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9a7e70e34f98a8eea5d18083634b6e908b23e619;p=gostls13.git cmd/compile: schedule OpArg earlier in blocks for better debugging The location list for OpArg starts where the OpArg appears; this is not necessarily as soon as the OpArg coulde be observed, and it is reasonable for a user to expect that if a breakpoint is set "on f" then the arguments to f will be observable where that breakpoint happens to be set (this may also require setting the breakpoint after the prologue, but that is another issue). Change-Id: I0a1b848e50f475e5d8a5fad781241126872a0400 Reviewed-on: https://go-review.googlesource.com/c/142819 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Heschi Kreinick Reviewed-by: Alessandro Arzilli Reviewed-by: Keith Randall --- diff --git a/src/cmd/compile/internal/ssa/schedule.go b/src/cmd/compile/internal/ssa/schedule.go index f1783a9532..9e19bb85b0 100644 --- a/src/cmd/compile/internal/ssa/schedule.go +++ b/src/cmd/compile/internal/ssa/schedule.go @@ -8,6 +8,7 @@ import "container/heap" const ( ScorePhi = iota // towards top of block + ScoreArg ScoreNilCheck ScoreReadTuple ScoreVarDef @@ -113,6 +114,9 @@ func schedule(f *Func) { case v.Op == OpVarDef: // We want all the vardefs next. score[v.ID] = ScoreVarDef + case v.Op == OpArg: + // We want all the args as early as possible, for better debugging. + score[v.ID] = ScoreArg case v.Type.IsMemory(): // Schedule stores as early as possible. This tends to // reduce register pressure. It also helps make sure