aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2025-05-21 14:33:13 -0400
committerCherry Mui <cherryyz@google.com>2025-05-21 20:07:36 -0700
commit5e6a868b28d3e7a71fa328c18ff5e93d72a1fb67 (patch)
tree6d026379ac2e2544116d72cddab70ef935418e6b /test/codegen
parent8bf816ae6879fa4537cc6e6e292769df2d7dbb78 (diff)
downloadgo-5e6a868b28d3e7a71fa328c18ff5e93d72a1fb67.tar.xz
cmd/compile, unique: model data flow of non-string pointers
Currently, hash/maphash.Comparable escapes its parameter if it contains non-string pointers, but does not escape strings or types that contain strings but no other pointers. This is achieved by a compiler intrinsic. unique.Make does something similar: it stores its parameter to a central map, with strings cloned. So from the escape analysis's perspective, the non-string pointers are passed through, whereas string pointers are not. We currently cannot model this type of type-dependent data flow directly in Go. So we do this with a compiler intrinsic. In fact, we can unify this and the intrinsic above. Tests are from Jake Bailey's CL 671955 (thanks!). Fixes #73680. Change-Id: Ia6a78e09dee39f8d9198a16758e4b5322ee2c56a Reviewed-on: https://go-review.googlesource.com/c/go/+/675156 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Jake Bailey <jacob.b.bailey@gmail.com>
Diffstat (limited to 'test/codegen')
0 files changed, 0 insertions, 0 deletions