From afd7c15c7f2d5ffd7e5f6234d76cc6698f86c06e Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 25 Sep 2023 13:42:19 -0700 Subject: cmd/compile: use cache in front of convI2I This is the last of the getitab users to receive a cache. We should now no longer see getitab (and callees) in profiles. Hopefully. Change-Id: I2ed72b9943095bbe8067c805da7f08e00706c98c Reviewed-on: https://go-review.googlesource.com/c/go/+/531055 Reviewed-by: Cuong Manh Le LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt Reviewed-by: Matthew Dempsky --- test/codegen/switch.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/codegen/switch.go') diff --git a/test/codegen/switch.go b/test/codegen/switch.go index b0186ba5b7..4103bf5297 100644 --- a/test/codegen/switch.go +++ b/test/codegen/switch.go @@ -125,6 +125,10 @@ type I interface { type J interface { bar() } +type IJ interface { + I + J +} // use a runtime call for type switches to interface types. func interfaceSwitch(x any) int { @@ -148,3 +152,9 @@ func interfaceCast(x any) int { } return 5 } + +func interfaceConv(x IJ) I { + // amd64:`CALL\truntime.typeAssert`,`MOVL\t16\(.*\)`,`MOVQ\t8\(.*\)(.*\*1)` + // arm64:`CALL\truntime.typeAssert`,`LDAR`,`MOVWU`,`MOVD\t\(R.*\)\(R.*\)` + return x +} -- cgit v1.3-5-g9baa