diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2019-10-30 10:29:47 -0700 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2020-03-02 16:24:47 +0000 |
commit | d7c073ecbfc3ecc506bfc753b271973b47f8bc15 (patch) | |
tree | 758702abba542e9b9c72a178e8ec34954e136fe5 /src/cmd/compile/internal/ssa/rewritedec64.go | |
parent | ab7ecea0c8dff908dfcad8c9091b71c6051bb94a (diff) | |
download | go-d7c073ecbfc3ecc506bfc753b271973b47f8bc15.tar.gz go-d7c073ecbfc3ecc506bfc753b271973b47f8bc15.zip |
cmd/compile: add specialized Value reset for OpCopy
This:
* Simplifies and shortens the generated code for rewrite rules.
* Shrinks cmd/compile by 86k (0.4%) and makes it easier to compile.
* Removes the stmt boundary code wrangling from Value.reset,
in favor of doing it in the one place where it actually does some work,
namely the writebarrier pass. (This was ascertained by inspecting the
code for cases in which notStmtBoundary values were generated.)
Passes toolstash-check -all.
Change-Id: I25671d4c4bbd772f235195d11da090878ea2cc07
Reviewed-on: https://go-review.googlesource.com/c/go/+/221421
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewritedec64.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/rewritedec64.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/cmd/compile/internal/ssa/rewritedec64.go b/src/cmd/compile/internal/ssa/rewritedec64.go index 3beaf8e99f..08a045ccac 100644 --- a/src/cmd/compile/internal/ssa/rewritedec64.go +++ b/src/cmd/compile/internal/ssa/rewritedec64.go @@ -441,9 +441,7 @@ func rewriteValuedec64_OpInt64Hi(v *Value) bool { } _ = v_0.Args[1] hi := v_0.Args[0] - v.reset(OpCopy) - v.Type = hi.Type - v.AddArg(hi) + v.copyOf(hi) return true } return false @@ -457,9 +455,7 @@ func rewriteValuedec64_OpInt64Lo(v *Value) bool { break } lo := v_0.Args[1] - v.reset(OpCopy) - v.Type = lo.Type - v.AddArg(lo) + v.copyOf(lo) return true } return false @@ -2174,9 +2170,7 @@ func rewriteValuedec64_OpTrunc64to32(v *Value) bool { break } lo := v_0.Args[1] - v.reset(OpCopy) - v.Type = lo.Type - v.AddArg(lo) + v.copyOf(lo) return true } return false |