]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: in poset, implement path collapsing
authorGiovanni Bajo <rasky@develer.com>
Fri, 27 Sep 2019 22:05:54 +0000 (00:05 +0200)
committerGiovanni Bajo <rasky@develer.com>
Sat, 26 Oct 2019 07:52:35 +0000 (07:52 +0000)
commitc70e5475e6ad21f4b5685ef18567a3e4e9388bbc
treee37d65712ad3aa3fe5ffdfe73960066e7ae1bbff
parent18d57bc89235ea04b6db1ef3e2d4a3106f0b739e
cmd/compile: in poset, implement path collapsing

Sometimes, poset needs to collapse a path making all nodes in
the path aliases. For instance, we know that A<=N1<=B and we
learn that B<=A, we can deduce A==N1==B, and thus we can
collapse all paths from A to B into a single aliased node.

Currently, this is a TODO. This CL implements the path-collapsing
primitive by doing a DFS walk to build a bitset of all nodes
across all paths, and then calling the new aliasnodes that allow
to mark multiple nodes as aliases of a single master node.

This helps only 4 times in std+cmd, but it will be fundamental
when we will rely on poset to calculate numerical limits, to
calculate the correct values.

This also fixes #35157, a bug uncovered by a previous CL in this
serie. A testcase will be added soon.

Change-Id: I5fc54259711769d7bd7c2d166a5abc1cddc26350
Reviewed-on: https://go-review.googlesource.com/c/go/+/200861
Run-TryBot: Giovanni Bajo <rasky@develer.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/poset.go
src/cmd/compile/internal/ssa/poset_test.go