cmd/compile: issue VarDef only for pointer-ful types

Use OpVarDef only when the variable being defined has pointers in it.
VarDef markers are only used for liveness analysis, and that only
runs on pointer-ful variables.

Fixes #53810

Change-Id: I09b0ef7ed31e72528916fe79325f80bbe69ff9b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/419320
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Joedian Reid <joedian@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
This commit is contained in:
Keith Randall 2022-07-24 13:24:21 -07:00
parent a726c9f662
commit a74e5f584e
4 changed files with 28 additions and 10 deletions

View file

@ -22,7 +22,7 @@ func TestCSEAuxPartitionBug(t *testing.T) {
arg1Aux := &tstAux{"arg1-aux"}
arg2Aux := &tstAux{"arg2-aux"}
arg3Aux := &tstAux{"arg3-aux"}
a := c.Frontend().Auto(src.NoXPos, c.config.Types.Int8)
a := c.Frontend().Auto(src.NoXPos, c.config.Types.Int8.PtrTo())
// construct lots of values with args that have aux values and place
// them in an order that triggers the bug
@ -93,7 +93,7 @@ func TestCSEAuxPartitionBug(t *testing.T) {
// TestZCSE tests the zero arg cse.
func TestZCSE(t *testing.T) {
c := testConfig(t)
a := c.Frontend().Auto(src.NoXPos, c.config.Types.Int8)
a := c.Frontend().Auto(src.NoXPos, c.config.Types.Int8.PtrTo())
fun := c.Fun("entry",
Bloc("entry",