diff options
author | David Chase <drchase@google.com> | 2020-08-07 22:46:43 -0400 |
---|---|---|
committer | David Chase <drchase@google.com> | 2020-10-01 17:47:21 +0000 |
commit | adef4deeb85ede59201f37f5145763ed55a807f7 (patch) | |
tree | 94879e4af8ab969d763fd0af0197bca11a69d8ec /src/cmd/compile/internal/ssa/value.go | |
parent | 75ea9953a812dcb2f64ea949054e529d9748d553 (diff) | |
download | go-adef4deeb85ede59201f37f5145763ed55a807f7.tar.gz go-adef4deeb85ede59201f37f5145763ed55a807f7.zip |
cmd/compile: enable late expansion for interface calls
Includes a few tweaks to Value.copyOf(a) (make it a no-op for
a self-copy) and new pattern hack "___" (3 underscores) is
like ellipsis, except the replacement doesn't need to have
matching ellipsis/underscores.
Moved the arg-length check in generated pattern-matching code
BEFORE the args are probed, because not all instances of
variable length OpFoo will have all the args mentioned in
some rule for OpFoo, and when that happens, the compiler
panics without the early check.
Change-Id: I66de40672b3794a6427890ff96c805a488d783f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/247537
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/value.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/value.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/value.go b/src/cmd/compile/internal/ssa/value.go index 94b8763d5d..edc43aaae7 100644 --- a/src/cmd/compile/internal/ssa/value.go +++ b/src/cmd/compile/internal/ssa/value.go @@ -348,6 +348,9 @@ func (v *Value) reset(op Op) { // It modifies v to be (Copy a). //go:noinline func (v *Value) copyOf(a *Value) { + if v == a { + return + } if v.InCache { v.Block.Func.unCache(v) } |