]> Cypherpunks repositories - gostls13.git/commit
cmd/5g etc: mechanical cleanup
authorRuss Cox <rsc@golang.org>
Mon, 2 Mar 2015 17:35:15 +0000 (12:35 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 2 Mar 2015 18:40:28 +0000 (18:40 +0000)
commit79f727a70e66fd0beabad36a9b1c7d0e0897a6a4
treec6f71b9cd5aae84f3d7cf1f63aba75ac1beb4cbc
parent190357d560b2bf4421c1819ebb9afe7aa175785c
cmd/5g etc: mechanical cleanup

Run rsc.io/grind rev a26569f on C->Go conversions.

The new change in grind is the inlining of goto targets.
If code says 'goto x' and the block starting at label x is unreachable
except through that goto and the code can be moved to where
the goto is without changing the meaning of its variable names,
grind does that move. Simlarly, a goto to a plain return statement
turns into that return statement (even if there are other paths to
the return statement).

Combined, these remove many long-distance gotos, which in turn
makes it possible to reduce the scope of more variable declarations.
(Because gotos can't jump across declarations, the gotos were
keeping the declarations from moving.)

Checked bit-for-bit compatibility with toolstash + buildall.

Reduces compiler runtime in html/template by about 12%.

Change-Id: Id727c0bd7763a61aa22f3daa00aeb8fccbc057a3
Reviewed-on: https://go-review.googlesource.com/6472
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
67 files changed:
src/cmd/5g/cgen.go
src/cmd/5g/ggen.go
src/cmd/5g/gsubr.go
src/cmd/5g/peep.go
src/cmd/5l/asm.go
src/cmd/5l/obj.go
src/cmd/6g/cgen.go
src/cmd/6g/ggen.go
src/cmd/6g/gsubr.go
src/cmd/6g/peep.go
src/cmd/6l/asm.go
src/cmd/8g/cgen.go
src/cmd/8g/cgen64.go
src/cmd/8g/ggen.go
src/cmd/8g/gsubr.go
src/cmd/8g/peep.go
src/cmd/8l/asm.go
src/cmd/9g/cgen.go
src/cmd/9g/ggen.go
src/cmd/9g/peep.go
src/cmd/9l/asm.go
src/cmd/internal/asm/asm.go
src/cmd/internal/asm/lexbody.go
src/cmd/internal/asm/macbody.go
src/cmd/internal/gc/const.go
src/cmd/internal/gc/cplx.go
src/cmd/internal/gc/lex.go
src/cmd/internal/gc/mparith1.go
src/cmd/internal/gc/mparith2.go
src/cmd/internal/gc/plive.go
src/cmd/internal/gc/reg.go
src/cmd/internal/gc/sinit.go
src/cmd/internal/gc/subr.go
src/cmd/internal/gc/typecheck.go
src/cmd/internal/gc/unsafe.go
src/cmd/internal/gc/util.go
src/cmd/internal/gc/walk.go
src/cmd/internal/ld/data.go
src/cmd/internal/ld/decodesym.go
src/cmd/internal/ld/dwarf.go
src/cmd/internal/ld/elf.go
src/cmd/internal/ld/go.go
src/cmd/internal/ld/ld.go
src/cmd/internal/ld/ldelf.go
src/cmd/internal/ld/ldmacho.go
src/cmd/internal/ld/ldpe.go
src/cmd/internal/ld/lib.go
src/cmd/internal/ld/macho.go
src/cmd/internal/ld/objfile.go
src/cmd/internal/ld/pcln.go
src/cmd/internal/ld/pe.go
src/cmd/internal/ld/sym.go
src/cmd/internal/ld/symtab.go
src/cmd/internal/ld/util.go
src/cmd/internal/obj/arm/asm5.go
src/cmd/internal/obj/arm/list5.go
src/cmd/internal/obj/arm/obj5.go
src/cmd/internal/obj/i386/asm8.go
src/cmd/internal/obj/i386/list8.go
src/cmd/internal/obj/i386/obj8.go
src/cmd/internal/obj/ppc64/asm9.go
src/cmd/internal/obj/ppc64/list9.go
src/cmd/internal/obj/ppc64/obj9.go
src/cmd/internal/obj/sym.go
src/cmd/internal/obj/x86/asm6.go
src/cmd/internal/obj/x86/list6.go
src/cmd/internal/obj/x86/obj6.go