mirror of https://github.com/golang/go.git
cmd/compile: only clobber dead slots at call sites
We now have safepoints at nearly all the instructions. When GOEXPERIMENT=clobberdead is on, it inserts clobbers nearly at every instruction. Currently this doesn't work. (Maybe the stack maps at non-call safepoints are still imprecise. I haven't investigated.) For now, only use call-based safepoints if the experiment is on. Updates #27326. Change-Id: I72cda9b422d9637cc5738e681502035af7a5c02d Reviewed-on: https://go-review.googlesource.com/131956 Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
c99687f87a
commit
c8545722a1
|
|
@ -671,7 +671,7 @@ func (lv *Liveness) pointerMap(liveout bvec, vars []*Node, args, locals bvec) {
|
||||||
|
|
||||||
// markUnsafePoints finds unsafe points and computes lv.unsafePoints.
|
// markUnsafePoints finds unsafe points and computes lv.unsafePoints.
|
||||||
func (lv *Liveness) markUnsafePoints() {
|
func (lv *Liveness) markUnsafePoints() {
|
||||||
if compiling_runtime || lv.f.NoSplit {
|
if compiling_runtime || lv.f.NoSplit || objabi.Clobberdead_enabled != 0 {
|
||||||
// No complex analysis necessary. Do this on the fly
|
// No complex analysis necessary. Do this on the fly
|
||||||
// in issafepoint.
|
// in issafepoint.
|
||||||
return
|
return
|
||||||
|
|
@ -830,7 +830,7 @@ func (lv *Liveness) issafepoint(v *ssa.Value) bool {
|
||||||
// go:nosplit functions are similar. Since safe points used to
|
// go:nosplit functions are similar. Since safe points used to
|
||||||
// be coupled with stack checks, go:nosplit often actually
|
// be coupled with stack checks, go:nosplit often actually
|
||||||
// means "no safe points in this function".
|
// means "no safe points in this function".
|
||||||
if compiling_runtime || lv.f.NoSplit {
|
if compiling_runtime || lv.f.NoSplit || objabi.Clobberdead_enabled != 0 {
|
||||||
return v.Op.IsCall()
|
return v.Op.IsCall()
|
||||||
}
|
}
|
||||||
switch v.Op {
|
switch v.Op {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue