]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: determine static values of len and cap in make() calls
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Mon, 17 Feb 2025 11:29:04 +0000 (11:29 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 19 Feb 2025 21:38:58 +0000 (13:38 -0800)
commitba3f568988bff69b3d00cd6ca76ab536eacbea48
tree123afe80487361f0212a26035700b8b139ace8ce
parent28d7eec3a23c04fb74863d032d499b76c3c3d4c3
cmd/compile: determine static values of len and cap in make() calls

This change improves escape analysis by attempting to
deduce static values for the len and cap parameters,
allowing allocations to be made on the stack.

Change-Id: I1161019aed9f60cf2c2fe4d405da94ad415231ac
GitHub-Last-Rev: d78c1b4ca55fa53282e665009f689d0b013f1434
GitHub-Pull-Request: golang/go#71693
Reviewed-on: https://go-review.googlesource.com/c/go/+/649035
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
src/cmd/compile/internal/escape/utils.go
test/escape_array.go
test/escape_make_non_const.go [new file with mode: 0644]
test/fixedbugs/issue41635.go