]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile/internal/ssa: handle dead code a different way
authorKeith Randall <khr@golang.org>
Fri, 28 Aug 2015 23:45:17 +0000 (16:45 -0700)
committerKeith Randall <khr@golang.org>
Sat, 29 Aug 2015 17:21:02 +0000 (17:21 +0000)
commit186cf1b9ba1358344b8ce6f2fb4a62302b98ba90
treef12bda6db5f3308e6e65863ed638f03a12e06a48
parent9654873a76f3234e55951b80f085e86b1ba9d754
[dev.ssa] cmd/compile/internal/ssa: handle dead code a different way

Instead of trying to delete dead code as soon as we find it, just
mark it as dead using a PlainAndDead block kind.  The deadcode pass
will do the real removal.

This way is somewhat more efficient because we don't need to mess
with successor and predecessor lists of all the dead blocks.

Fixes #12347

Change-Id: Ia42d6b5f9cdb3215a51737b3eb117c00bd439b13
Reviewed-on: https://go-review.googlesource.com/14033
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/ssa/check.go
src/cmd/compile/internal/ssa/deadcode.go
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/gen/rulegen.go
src/cmd/compile/internal/ssa/nilcheck.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewritegeneric.go
test/fixedbugs/issue12347.go [new file with mode: 0644]