]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: earlier deadcode removal
authorMatthew Dempsky <mdempsky@google.com>
Fri, 1 Jan 2021 09:32:46 +0000 (01:32 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 1 Jan 2021 10:52:39 +0000 (10:52 +0000)
commit6ddbc75efd4bc2757e7684e7760ee411ec721e15
treed61da828fa5a1af03d37bc756c11c61cdd7d0a46
parent68e6fa4f6852b4ef0fe61789618c093f4e2185c9
[dev.regabi] cmd/compile: earlier deadcode removal

This CL moves the general deadcode-removal pass to before computing
Addrtaken, which allows variables to still be converted to SSA if
their address is only taken in unreachable code paths (e.g., the "&mp"
expression in the "if false" block in runtime/os_linux.go:newosproc).

This doesn't pass toolstash -cmp, because it allows SSA to better
optimize some code.

Change-Id: I43e54acc02fdcbad8eb6493283f355aa1ee0de84
Reviewed-on: https://go-review.googlesource.com/c/go/+/280992
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/gc/main.go