-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: inlining heuristic does not know code is dead #9274
Comments
I'm beginning to suspect that it's just too complicated to inline. $ cat t.go import "unsafe" func readUnaligned64(p unsafe.Pointer) uint64 {
$ cat t2.go import "unsafe" func readUnaligned64(p unsafe.Pointer) uint64 { |
At least when GOARCH=="amd64", it would be nice if it inlined. |
On Thu, Dec 11, 2014 at 8:45 PM, randall77 notifications@github.com wrote:
|
You think unaligned1.go and unaligned2.go, each with appropriate build tags, is the way to go? |
On Thu, Dec 11, 2014 at 10:12 PM, randall77 notifications@github.com
If the endian doesn't matter, I also recommend change the function name to |
CL https://golang.org/cl/37499 mentions this issue. |
The inlining decisions by the compiler are made before the compiler knows about dead code in the inlined routine. For instance, both of these functions inline:
but combine them with a compile-time-constant if, and it doesn't inline:
The text was updated successfully, but these errors were encountered: