-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: remove instruction reordering by obj package #15837
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
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Performance
Milestone
Comments
SGTM |
I agree, and do we get better register allocation if we peel the loop head pre-regalloc? Doing this in SSA also has the possibility of automatically hoisting loop-invariant expressions out through CSE, depending on how much the CMP drags with it. |
This was referenced Mar 20, 2017
CL https://golang.org/cl/38431 mentions this issue. |
CL https://golang.org/cl/38664 mentions this issue. |
gopherbot
pushed a commit
that referenced
this issue
Mar 26, 2017
We don't need them any more since #15837 was fixed. Fixes #19718 Change-Id: I13e46c62b321b2c9265f44c977b63bfb23163ca2 Reviewed-on: https://go-review.googlesource.com/38664 Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Josh Bleecher Snyder <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Performance
It's confusing, especially to assembly writers, when obj package reorders their instructions from under them. It also interferes with any instruction layout done earlier in the compiler, e.g. SSA scheduling.
It may be as simple as removing the Follow pass from cmd/internal/obj/plist.go (and all the associated code for each arch).
The follow pass does the following optimization: for unconditional branches, copy a few instructions from the destination instead of jumping to the copy.
For typical loops, SSA currently generates:
The follow pass rewrites this to:
We probably want to do this loop head peeling some other way (in SSA?).
@rsc
The text was updated successfully, but these errors were encountered: