]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: teach prove about bitwise OR operation
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Mon, 10 Apr 2023 04:08:25 +0000 (11:08 +0700)
committerGopher Robot <gobot@golang.org>
Mon, 10 Apr 2023 17:13:41 +0000 (17:13 +0000)
commit63a08e61bd5ac5132ed160351933622443c16b58
treeb799857dcfabc607e8079441ddd5094990302cb8
parenta3f3868c7aa66d2290d1a51aebacce88cb584f37
cmd/compile: teach prove about bitwise OR operation

For now, only apply the rule if either of arguments are constants. That
would catch a lot of real user code, without slowing down the compiler
with code generated for string comparison (experience in CL 410336).

Updates #57959
Fixes #45928

Change-Id: Ie2e830d6d0d71cda3947818b22c2775bd94f7971
Reviewed-on: https://go-review.googlesource.com/c/go/+/483359
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/prove.go
test/prove.go