• 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
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...