cmd/compile: remove instruction reordering by obj package #15837
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Performance
Milestone
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: