what is empty block mean in ssa.Block?

127 views
Skip to first unread message

xie cui

unread,
Aug 24, 2020, 3:24:06 PM8/24/20
to golang-nuts
https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/fuse.go#L130
it mention empty block here. in my knowledge, empty block would be len(b.Values) == 0, but it's not. so what 's empty block means here.

keith....@gmail.com

unread,
Aug 24, 2020, 11:39:55 PM8/24/20
to golang-nuts
Empty here means has-only-dead-values. All the values still in s0 and s1 are known to be dead.

xie cui

unread,
Aug 25, 2020, 10:09:13 AM8/25/20
to golang-nuts
so what's dead value means? in my mind, dead value can be ignore, why we need to append it to b.Values?

Keith Randall

unread,
Aug 25, 2020, 2:54:44 PM8/25/20
to xie cui, golang-nuts
On Tue, Aug 25, 2020 at 3:10 AM xie cui <cuiw...@gmail.com> wrote:
so what's dead value means? in my mind, dead value can be ignore, why we need to append it to b.Values?


Dead means no longer used. Their values are ignored.
We put them in b.Values so that they get cleaned up properly. See the deadcode pass for what proper cleanup looks like.
 
On Tuesday, August 25, 2020 at 7:39:55 AM UTC+8 keith....@gmail.com wrote:
Empty here means has-only-dead-values. All the values still in s0 and s1 are known to be dead.

On Monday, August 24, 2020 at 8:24:06 AM UTC-7, xie cui wrote:
https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/fuse.go#L130
it mention empty block here. in my knowledge, empty block would be len(b.Values) == 0, but it's not. so what 's empty block means here.

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/_Ic7n4d9qRo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e592df28-1532-4cd0-b0fc-b346bf2d39f4n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages