]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fold constant shifts into (SHL|SHR|SAR)Xload ops
authorKeith Randall <khr@golang.org>
Thu, 14 Apr 2022 00:33:24 +0000 (17:33 -0700)
committerKeith Randall <khr@google.com>
Thu, 14 Apr 2022 15:54:48 +0000 (15:54 +0000)
commitcb702a2a5670d4fa599f573b37b1a01abc9f995a
tree8335066664fba8c50b78e5d8dcd3053d592b3608
parentd2552037426fe5a190c74172562d897d921fe311
cmd/compile: fold constant shifts into (SHL|SHR|SAR)Xload ops

We should prefer a constant shift op to a X shift op.
That way we don't have to materialize the constant to shift by.

Should fix GOAMD64=v3 builder

Change-Id: I56b45d2940c959382b970e3f962ed4a09cc2a239
Reviewed-on: https://go-review.googlesource.com/c/go/+/400254
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Wayne Zuo <wdvxdr@golangcn.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewriteAMD64.go