Skip to content
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: getcallerpc ought to be intrinsified #17327

Closed
dr2chase opened this issue Oct 3, 2016 · 6 comments
Closed

cmd/compile: getcallerpc ought to be intrinsified #17327

dr2chase opened this issue Oct 3, 2016 · 6 comments
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Performance
Milestone

Comments

@dr2chase
Copy link
Contributor

dr2chase commented Oct 3, 2016

Reasons:

  • getcallerpc gets called in many places; even in assembly language, a call is a call
  • the compiler has a pretty good idea of where it put the caller's PC.
  • taking the address of the first parameter reduces opportunities for optimization somewhat, though of course SSA could be smarter about noescape functions.
  • relying on the first parameter having an address in the caller's frame with a firm relationship to the saved return PC locks down our existing calling conventions; there are other obstacles to changing them and we might not change this part of them, but it's not a feature.
@crawshaw
Copy link
Member

crawshaw commented Oct 3, 2016

getcallerpc is on the entersyscall critical path so it may have positive effects on unexpected benchmarks.

@quentinmit quentinmit changed the title getcallerpc ought to be intrinsified cmd/compile: getcallerpc ought to be intrinsified Oct 3, 2016
@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 3, 2016
@quentinmit quentinmit added this to the Go1.8 milestone Oct 3, 2016
@rsc
Copy link
Contributor

rsc commented Oct 21, 2016

If you want to do this for Go 1.8, please do it soon.

@cherrymui
Copy link
Member

getcallerpc currently has stack barrier logic in it. Maybe do it after removing stack barrier?

@dr2chase
Copy link
Contributor Author

This looks iffy for 1.8, but I'll see.

@josharian
Copy link
Contributor

Definitely missed the 1.9 window on this. Marking 1.10Early.

@josharian josharian modified the milestones: Go1.10Early, Go1.9 May 17, 2017
@bradfitz bradfitz added early-in-cycle A change that should be done early in the 3 month dev cycle. and removed early-in-cycle A change that should be done early in the 3 month dev cycle. labels Jun 14, 2017
@bradfitz bradfitz modified the milestones: Go1.10Early, Go1.10 Jun 14, 2017
@gopherbot
Copy link

Change https://golang.org/cl/31851 mentions this issue: cmd/compile: add intrinsic for reading caller's pc

@golang golang locked and limited conversation to collaborators Sep 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Performance
Projects
None yet
Development

No branches or pull requests

9 participants