From c8545722a105f4a21583aeee00adcbd01436b98b Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Wed, 29 Aug 2018 11:55:55 -0400 Subject: [PATCH] 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 --- src/cmd/compile/internal/gc/plive.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go index f78d051b06..be53384c1f 100644 --- a/src/cmd/compile/internal/gc/plive.go +++ b/src/cmd/compile/internal/gc/plive.go @@ -671,7 +671,7 @@ func (lv *Liveness) pointerMap(liveout bvec, vars []*Node, args, locals bvec) { // markUnsafePoints finds unsafe points and computes lv.unsafePoints. 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 // in issafepoint. return @@ -830,7 +830,7 @@ func (lv *Liveness) issafepoint(v *ssa.Value) bool { // go:nosplit functions are similar. Since safe points used to // be coupled with stack checks, go:nosplit often actually // 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() } switch v.Op { -- 2.50.0