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: use lineno for scheduler tiebreaking #14577

Closed
josharian opened this issue Feb 29, 2016 · 4 comments
Closed

cmd/compile: use lineno for scheduler tiebreaking #14577

josharian opened this issue Feb 29, 2016 · 4 comments
Milestone

Comments

@josharian
Copy link
Contributor

The dev.ssa scheduler adds values with the same priority and use count in whatever order they previously occurred. I suggest that we take lineno into account as a third tier sorting parameter. The goal would be to find the value with the lineno closest to the most recently scheduled value. This will do two things. (1) Make debugging nicer by having instructions better follow the original code. (2) Reduce value deltas in the pcln table, possibly making it smaller.

Opinions?

cc @randall77 @derekparker @crawshaw @tzneal

@josharian josharian added this to the dev.ssa milestone Feb 29, 2016
@randall77
Copy link
Contributor

Sounds fine. I just talked to David about redoing some scheduler priorities to reduce register pressure. Both might be doable as part of a rewrite.
@dr2chase

@bradfitz bradfitz modified the milestones: dev.ssa, Go1.7 Mar 2, 2016
@tzneal
Copy link
Member

tzneal commented Mar 2, 2016

Slightly related, regalloc was one place I was going to look at when I got some time in order to try to speed up compilation speed. It shows up often as the longest running and most allocating pass.

Top 10 longest running passes for make.bash:

Function Pass Time nBytes nAllocs
deadcode regalloc 0.181994 1031696 3946
(*state).expr regalloc 0.17228 8357768 23128
rewriteValueAMD64_OpRsh8x64 flagalloc 0.167941 2752 3
caseClauses regalloc 0.161555 502368 1915
decode1 regalloc 0.135603 15555416 40390
(*builder).cgo regalloc 0.1225 5644296 24044
rewriteValueAMD64_OpLsh16x16 regalloc 0.122127 608776 2056
rewriteBlockAMD64 regalloc 0.119063 4687664 8646
ldelf lowered cse 0.09917 510976 46

Most Allocs:

Function Pass Time nBytes nAllocs
decode1 regalloc 0.135603 15555416 40390
rewriteValueAMD64_OpMove regalloc 0.041561 11790192 33403
rewriteValuegeneric_OpStore regalloc 0.026762 11132712 29137
rewriteValuegeneric_OpLoad regalloc 0.020026 9962688 25542
walkexpr regalloc 0.023573 9572864 25354
(*builder).cgo regalloc 0.1225 5644296 24044
typecheck1 regalloc 0.031045 10169840 23171
(*state).expr regalloc 0.17228 8357768 23128
(*regAllocState).regalloc regalloc 0.047459 8279952 23022
rewriteValueAMD64_OpZero regalloc 0.015275 6996376 19277

Most Bytes Alloced:

Function Pass Time nBytes nAllocs
decode1 regalloc 0.135603 15555416 40390
rewriteValueAMD64_OpMove regalloc 0.041561 11790192 33403
rewriteValuegeneric_OpStore regalloc 0.026762 11132712 29137
typecheck1 regalloc 0.031045 10169840 23171
rewriteValuegeneric_OpLoad regalloc 0.020026 9962688 25542
init regalloc 0.042641 9622824 8667
walkexpr regalloc 0.023573 9572864 25354
(*state).expr regalloc 0.17228 8357768 23128
(*regAllocState).regalloc regalloc 0.047459 8279952 23022
rewriteValueAMD64_OpZero regalloc 0.015275 6996376 19277

@dr2chase
Copy link
Contributor

dr2chase commented Mar 2, 2016

We could also use this to break ties for block-ordering -- it doesn't do squat for performance, but it makes wading through the asm slightly easier.

@dr2chase dr2chase self-assigned this Mar 2, 2016
@gopherbot
Copy link

CL https://golang.org/cl/20240 mentions this issue.

@golang golang locked and limited conversation to collaborators Mar 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants