]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: preserve statements in late nilcheckelim optimization
authorDavid Chase <drchase@google.com>
Wed, 9 Oct 2019 22:06:06 +0000 (18:06 -0400)
committerDavid Chase <drchase@google.com>
Tue, 15 Oct 2019 16:43:44 +0000 (16:43 +0000)
commit6adaf17eaaa7f2a8ec59a01f5b7280db210b3e75
tree220e516cae1a828049f9234b9e99cd16ff88760a
parentc2c2ba280c77e76115cf1918d91a509f6bf98390
cmd/compile: preserve statements in late nilcheckelim optimization

When a subsequent load/store of a ptr makes the nil check of that pointer
unnecessary, if their lines differ, change the line of the load/store
to that of the nilcheck, and attempt to rehome the load/store position
instead.

This fix makes profiling less accurate in order to make panics more
informative.

Fixes #33724

Change-Id: Ib9afaac12fe0d0320aea1bf493617facc34034b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/200197
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/nilcheck.go
src/cmd/compile/internal/ssa/numberlines.go
test/codegen/memcombine.go
test/fixedbugs/issue33724.go [new file with mode: 0644]