diff options
author | David Chase <drchase@google.com> | 2018-10-26 12:00:07 -0400 |
---|---|---|
committer | David Chase <drchase@google.com> | 2018-11-29 14:00:26 +0000 |
commit | 2b58ca6e3de3d93817a4e6cc55378015eb3c2040 (patch) | |
tree | 0f255bde39d3a544ec1ac6b1ea62a752f0c7a796 /src/cmd/compile/internal/ssa/tighten.go | |
parent | 311d87dbebbb0238196d3aa13fd9a37f655e1fc3 (diff) | |
download | go-2b58ca6e3de3d93817a4e6cc55378015eb3c2040.tar.gz go-2b58ca6e3de3d93817a4e6cc55378015eb3c2040.zip |
cmd/compile: begin OpArg and OpPhi location lists at block start
For the entry block, make the "first instruction" be truly
the first instruction. This allows printing of incoming
parameters with Delve.
Also be sure Phis are marked as being at the start of their
block. This is observed to move location list pointers,
and where moved, they become correct.
Leading zero-width instructions include LoweredGetClosurePtr.
Because this instruction is actually architecture-specific,
and it is now tested for in 3 different places, also created
Op.isLoweredGetClosurePtr() to reduce future surprises.
Change-Id: Ic043b7265835cf1790382a74334b5714ae4060af
Reviewed-on: https://go-review.googlesource.com/c/145179
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/tighten.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/tighten.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/ssa/tighten.go b/src/cmd/compile/internal/ssa/tighten.go index 3713269376..580a06dfde 100644 --- a/src/cmd/compile/internal/ssa/tighten.go +++ b/src/cmd/compile/internal/ssa/tighten.go @@ -13,15 +13,14 @@ func tighten(f *Func) { canMove := make([]bool, f.NumValues()) for _, b := range f.Blocks { for _, v := range b.Values { + if v.Op.isLoweredGetClosurePtr() { + // Must stay in the entry block. + continue + } switch v.Op { - case OpPhi, OpArg, OpSelect0, OpSelect1, - OpAMD64LoweredGetClosurePtr, Op386LoweredGetClosurePtr, - OpARMLoweredGetClosurePtr, OpARM64LoweredGetClosurePtr, - OpMIPSLoweredGetClosurePtr, OpMIPS64LoweredGetClosurePtr, - OpS390XLoweredGetClosurePtr, OpPPC64LoweredGetClosurePtr, - OpWasmLoweredGetClosurePtr: + case OpPhi, OpArg, OpSelect0, OpSelect1: // Phis need to stay in their block. - // GetClosurePtr & Arg must stay in the entry block. + // Arg must stay in the entry block. // Tuple selectors must stay with the tuple generator. continue } |