• Josh Bleecher Snyder's avatar
    cmd/gc: don't give credit for NOPs during register allocation · 1848d714
    Josh Bleecher Snyder authored
    The register allocator decides which variables should be placed into registers by charging for each load/store and crediting for each use, and then selecting an allocation with minimal cost. NOPs will be eliminated, however, so using a variable in a NOP should not generate credit.
    
    Issue 7867 arises from attempted registerization of multi-word variables because they are used in NOPs. By not crediting for that use, they will no longer be considered for registerization.
    
    This fix could theoretically lead to better register allocation, but NOPs are rare relative to other instructions.
    
    Fixes #7867.
    
    LGTM=rsc
    R=rsc
    CC=golang-codereviews
    https://golang.org/cl/94810044
    1848d714
Name
Last commit
Last update
..
Makefile Loading commit data...
cgen.c Loading commit data...
doc.go Loading commit data...
galign.c Loading commit data...
gg.h Loading commit data...
ggen.c Loading commit data...
gobj.c Loading commit data...
gsubr.c Loading commit data...
opt.h Loading commit data...
peep.c Loading commit data...
prog.c Loading commit data...
reg.c Loading commit data...