]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix wrong optimization for eliding Not in Phi
authorWayne Zuo <wdvxdr@golangcn.org>
Thu, 17 Nov 2022 10:10:00 +0000 (18:10 +0800)
committerDavid Chase <drchase@google.com>
Fri, 18 Nov 2022 13:26:33 +0000 (13:26 +0000)
commit8893da7c724cf5df859a3c4ef6f32d94f0b39a00
tree22beae2f15f5ee7b8099968cfe62e2f6ef2d6b2a
parent205f636e0ab491b7a06e7b7879abb897cdaaf1b4
cmd/compile: fix wrong optimization for eliding Not in Phi

The previous rule may move the phi value into a wrong block.
This CL make it only rewrite the phi value not the If block,
so that the phi value will stay in old block.

Fixes #56777

Change-Id: I9479a5c7f28529786968413d35b82a16181bb1f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/451496
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/_gen/generic.rules
src/cmd/compile/internal/ssa/rewritegeneric.go
test/fixedbugs/issue56777.go [new file with mode: 0644]