You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/compile: simple functions in compress/flate, inlined in go1.10 no longer inlined #27621
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
tip
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
ppc64le Ubuntu 16.04
What did you do?
Inspecting code from compress/flate, noticed some simple functions that I would expect to be inlined that are not.
What did you expect to see?
Functions compress/flate.byLiteral.Len, compress/flate.byLiteral.Less, compress/flate.byLiteral.Swap, compress/flate.byFreq.Len, compress/flate.byFreq.Less, compress/flate.byFreq.Swap inlined as was done in go 1.10.
What did you see instead?
No inlining for these functions on the latest branch or in go 1.11.
I just built the test in compress/flate and looked at the code. Not sure if you need more information.
I did add the -m=2 option and the output said those functions should be inlined.
Forgot to mention: they aren't being inlined in the corresponding functions like these:
compress/flate.(*byLiteral).Len
compress/flate.(*byLiteral).Less
compress/flate.(*byLiteral).Swap
compress.flate.(*byFreq).Len
compress.flate.(*byFreq).Less
compress.flate.(*byFreq).Swap
Activity
laboger commentedon Sep 11, 2018
Forgot to mention: they aren't being inlined in the corresponding functions like these:
compress/flate.(*byLiteral).Len
compress/flate.(*byLiteral).Less
compress/flate.(*byLiteral).Swap
compress.flate.(*byFreq).Len
compress.flate.(*byFreq).Less
compress.flate.(*byFreq).Swap
TocarIP commentedon Sep 11, 2018
Looks like #25338
gopherbot commentedon Sep 17, 2018
Change https://golang.org/cl/135697 mentions this issue:
cmd/compile/internal/gc: inline autogenerated (*T).M wrappersandybons commentedon Sep 26, 2018
@laboger if you apply the above fix locally, is the issue resolved? If so, I'll close this as a dupe of #25338
laboger commentedon Sep 26, 2018
I tried the fix above and the functions are now inlined.
andybons commentedon Sep 26, 2018
@laboger thank you. Closing as a dupe of #25338.
cmd/compile/internal/gc: inline autogenerated (*T).M wrappers