]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/devirtualize: improve concrete type analysis
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Tue, 7 Oct 2025 17:57:59 +0000 (17:57 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 8 Oct 2025 21:09:22 +0000 (14:09 -0700)
commitde9da0de30377532370a09a311851afc0616c185
tree7fef53d0cc90c3a34752540d1dc5de99ff3d5efa
parentae094a1397d03aafde380cdb79e0d6a5731c8dbc
cmd/compile/internal/devirtualize: improve concrete type analysis

This change improves the concrete type analysis in the devirtualizer,
it not longer relies on ir.Reassigned, it now statically tries to
determine the concrete type of an interface, even when assigned
multiple times, following type assertions and iface conversions.

Alternative to CL 649195

Updates #69521
Fixes #64824

Change-Id: Ib1656e19f3619ab2e1e6b2c78346cc320490b2af
GitHub-Last-Rev: e8fa0b12f0a7b1d7ae00e5edb54ce04d1f702c09
GitHub-Pull-Request: golang/go#71935
Reviewed-on: https://go-review.googlesource.com/c/go/+/652036
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
12 files changed:
src/cmd/compile/internal/devirtualize/devirtualize.go
src/cmd/compile/internal/inline/interleaved/interleaved.go
src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/ssagen/ssa.go
src/crypto/sha256/sha256_test.go
src/runtime/pprof/pprof_test.go
test/devirtualization.go [new file with mode: 0644]
test/devirtualization_nil_panics.go [new file with mode: 0644]
test/devirtualization_with_type_assertions_interleaved.go [new file with mode: 0644]
test/fixedbugs/issue42284.dir/a.go
test/fixedbugs/issue42284.dir/b.go