cmd/6g, cmd/8g: eliminate extra agen for nil comparisons.
Removes an extra LEAL/LEAQ instructions there and usually saves a useless temporary in the idiom if err := foo(); err != nil {...} Generated code is also less involved: MOVQ err+n(SP), AX CMPQ AX, $0 (potentially CMPQ n(SP), $0) instead of LEAQ err+n(SP), AX CMPQ (AX), $0 Update #1914. R=daniel.morsing, nigeltao, rsc CC=golang-dev, remy https://golang.org/cl/6493099
Showing
Please
register
or
sign in
to comment