Commit c8545722 authored by Cherry Zhang's avatar Cherry Zhang

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/131956Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent c99687f8
......@@ -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 {
......
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