]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: remove useless block-indirection in type switch
authorMatthew Dempsky <mdempsky@google.com>
Mon, 7 Oct 2019 20:33:39 +0000 (13:33 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 7 Oct 2019 20:58:25 +0000 (20:58 +0000)
commitab00f89c2742792ae23c6861e82c4b0b6cc6376b
tree1589dbd7462ca8a4c821f8e7a1c71ea3232b7881
parente1446d9cee91af263af15efe8291644b590bb9ff
cmd/compile: remove useless block-indirection in type switch

Previously, when emitting type switches without an explicit "case nil"
clause, we would emit:

    if x == nil { goto Lnil }
    ...
    Lnil: goto Ldefault

But we can instead just emit:

    if x == nil { goto Ldefault }

Doesn't pass toolstash-check; seems like it causes some harmless
instruction scheduling changes.

Change-Id: Ie233dda26756911e93a08b3db40407ba38694c62
Reviewed-on: https://go-review.googlesource.com/c/go/+/199644
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/swt.go