summaryrefslogtreecommitdiff
path: root/test/escape_iface_unified.go
Commit message (Collapse)AuthorAgeFilesLines
* cmd: remove GOEXPERIMENT=nounified knobMatthew Dempsky2023-01-251-2/+0
| | | | | | | | | | | | | | This CL removes the GOEXPERIMENT=nounified knob, and any conditional statements that depend on that knob. Further CLs to remove unreachable code follow this one. Updates #57410. Change-Id: I39c147e1a83601c73f8316a001705778fee64a91 Reviewed-on: https://go-review.googlesource.com/c/go/+/458615 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
* [dev.unified] cmd/compile/internal/noder: implicit conversions for ↵Matthew Dempsky2022-06-301-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multi-valued expressions This CL changes GOEXPERIMENT=unified to insert implicit conversions for multi-valued expressions. Unfortunately, IR doesn't have strong, first-class support for multi-valued expressions, so this CL takes the approach of spilling them to temporary variables, which can then be implicitly converted. This is the same approach taken by walk, but doing it this early does introduce some minor complications: 1. For select case clauses with comma-ok assignments (e.g., `case x, ok := <-ch:`), the compiler middle end wants to see the OAS2RECV assignment is the CommClause.Comm statement. So when constructing select statements, we need to massage this around a little. 2. The extra temporary variables and assignments skew the existing inlining heuristics. As mentioned, the temporaries/assignments will eventually be added (and often optimized away again) anyway, but now they're visible to the inliner. So this CL also kludges the inlining heuristics in this case to keep things comparable. Change-Id: I3e3ea756ad92472ebe28bae3963be61ed7684a75 Reviewed-on: https://go-review.googlesource.com/c/go/+/415244 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
* [dev.unified] test: break escape_iface.go into unified/nounified variantsMatthew Dempsky2022-06-301-0/+25
The assignment `sink, *(&ok) = y.(int)` should (and does) escape a value to the heap, but this detail is missed because the implicit conversion of the multi-value expression `y.(int)` isn't visible to escape analysis (because it's not inserted until desugaring during walk). For Unified IR, I plan to apply this desugaring earlier (because it's necessary for correct dictionary handling), which means we'll now (correctly) report the heap escape. Due to limitations of the $GOROOT/test harness, the easiest way to handle that GOEXPERIMENT=unified gets this right while GOEXPERIMENT=nounified does not is to split the test case into separate files. Hence this CL. Change-Id: I91f3a6c015cbc646ab018747e152cac2874cf24c Reviewed-on: https://go-review.googlesource.com/c/go/+/415241 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>