aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/liveness
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-01-11 22:58:23 -0800
committerMatthew Dempsky <mdempsky@google.com>2021-01-14 06:10:09 +0000
commitf97983249a812c2b079a489fc990fbeb3695be4d (patch)
tree2ecf5ed8eab72fa168faa97436ec0d1e708c4439 /src/cmd/compile/internal/liveness
parent447630042588a14aec6680e624113258d3849d49 (diff)
downloadgo-f97983249a812c2b079a489fc990fbeb3695be4d.tar.gz
go-f97983249a812c2b079a489fc990fbeb3695be4d.zip
[dev.regabi] cmd/compile: move more PAUTOHEAP to SSA construction
This CL moves almost all PAUTOHEAP handling code to SSA construction. Instead of changing Names to PAUTOHEAP, escape analysis now only sets n.Esc() to ir.EscHeap, and SSA handles creating the "&x" pseudo-variables and associating them via Heapaddr. This CL also gets rid of n.Stackcopy, which was used to distinguish the heap copy of a parameter used within a function from the stack copy used in the function calling convention. In practice, this is always obvious from context: liveness and function prologue/epilogue want to know about the stack copies, and everywhere else wants the heap copy. Hopefully moving all parameter/result handling into SSA helps with making the register ABI stuff easier. Also, the only remaining uses of PAUTOHEAP are now for closure variables, so I intend to rename it to PCLOSUREVAR or get rid of those altogether too. But this CL is already big and scary enough. Change-Id: Ief5ef6205041b9d0ee445314310c0c5a98187e77 Reviewed-on: https://go-review.googlesource.com/c/go/+/283233 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/liveness')
-rw-r--r--src/cmd/compile/internal/liveness/plive.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/liveness/plive.go b/src/cmd/compile/internal/liveness/plive.go
index 8d1754c813..abc9583d5a 100644
--- a/src/cmd/compile/internal/liveness/plive.go
+++ b/src/cmd/compile/internal/liveness/plive.go
@@ -181,7 +181,7 @@ type progeffectscache struct {
// nor do we care about empty structs (handled by the pointer check),
// nor do we care about the fake PAUTOHEAP variables.
func ShouldTrack(n *ir.Name) bool {
- return (n.Class == ir.PAUTO || n.Class == ir.PPARAM || n.Class == ir.PPARAMOUT) && n.Type().HasPointers()
+ return (n.Class == ir.PAUTO && n.Esc() != ir.EscHeap || n.Class == ir.PPARAM || n.Class == ir.PPARAMOUT) && n.Type().HasPointers()
}
// getvariables returns the list of on-stack variables that we need to track
@@ -788,7 +788,7 @@ func (lv *liveness) epilogue() {
if n.Class == ir.PPARAM {
continue // ok
}
- base.Fatalf("bad live variable at entry of %v: %L", lv.fn.Nname, n)
+ base.FatalfAt(n.Pos(), "bad live variable at entry of %v: %L", lv.fn.Nname, n)
}
// Record live variables.