From: David Chase Date: Thu, 9 Nov 2023 16:43:13 +0000 (-0500) Subject: cmd/compile: small inlining tweak for range-func panics X-Git-Tag: go1.22rc1~311 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2380862c7c05666f9bfe799fb1222cb4e5631541;p=gostls13.git cmd/compile: small inlining tweak for range-func panics treat the panic, like a panic. It helps with inlining, and thus reduced closure allocation and performance, for many examples of function range iterators. Change-Id: Ib1a656cdfa56eb2dee400089c4c94ac14f1d2104 Reviewed-on: https://go-review.googlesource.com/c/go/+/541235 Run-TryBot: David Chase Reviewed-by: Matthew Dempsky TryBot-Result: Gopher Robot --- diff --git a/src/cmd/compile/internal/inline/inl.go b/src/cmd/compile/internal/inline/inl.go index c2d3effd65..4009b776ea 100644 --- a/src/cmd/compile/internal/inline/inl.go +++ b/src/cmd/compile/internal/inline/inl.go @@ -528,6 +528,8 @@ opSwitch: case "throw": v.budget -= inlineExtraThrowCost break opSwitch + case "panicrangeexit": + cheap = true } // Special case for reflect.noescape. It does just type // conversions to appease the escape analysis, and doesn't