]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "cmd/compile: make OpAddr depend on VarDef in storeOrder"
authorDavid Chase <drchase@google.com>
Fri, 29 Jun 2018 19:47:19 +0000 (19:47 +0000)
committerDavid Chase <drchase@google.com>
Fri, 29 Jun 2018 19:48:48 +0000 (19:48 +0000)
This reverts commit 1a27f048ad25f151d2a17ce7f2d73d0d2dbe94cf.

Reason for revert: Broke the ssacheck and -N-l builders, and the -N-l fix looks like it will take some time and take a different route entirely.

Change-Id: Ie0ac5e86ab7d72a303dfbbc48dfdf1e092d4f61a
Reviewed-on: https://go-review.googlesource.com/121715
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/schedule.go
test/fixedbugs/issue26105.go [deleted file]

index c62c0c47e24c867ef437ba9fa63213e5a93cfd43..f1783a9532efe04be1dba3d2b0e76c1a9b0d8a1d 100644 (file)
@@ -310,7 +310,6 @@ func storeOrder(values []*Value, sset *sparseSet, storeNumber []int32) []*Value
        // A constant bound allows this to be stack-allocated. 64 is
        // enough to cover almost every storeOrder call.
        stores := make([]*Value, 0, 64)
-       var vardefs map[interface{}]*Value // OpAddr must depend on Vardef for Node
        hasNilCheck := false
        sset.clear() // sset is the set of stores that are used in other values
        for _, v := range values {
@@ -324,12 +323,6 @@ func storeOrder(values []*Value, sset *sparseSet, storeNumber []int32) []*Value
                if v.Op == OpNilCheck {
                        hasNilCheck = true
                }
-               if v.Op == OpVarDef {
-                       if vardefs == nil { // Lazy init, not all blocks have vardefs
-                               vardefs = make(map[interface{}]*Value)
-                       }
-                       vardefs[v.Aux] = v
-               }
        }
        if len(stores) == 0 || !hasNilCheck && f.pass.name == "nilcheckelim" {
                // there is no store, the order does not matter
@@ -393,20 +386,7 @@ func storeOrder(values []*Value, sset *sparseSet, storeNumber []int32) []*Value
                                stack = stack[:len(stack)-1]
                                continue
                        }
-                       if w.Op == OpAddr {
-                               // OpAddr depends only on relevant VarDef
-                               vn := int32(0)
-                               if vardefs != nil {
-                                       if a := vardefs[w.Aux]; a != nil { // if nil, it is in some other block, or global or arg
-                                               vn = storeNumber[a.ID]
-                                       }
-                               }
-                               vn += 2
-                               storeNumber[w.ID] = vn
-                               count[vn]++
-                               stack = stack[:len(stack)-1]
-                               continue
-                       }
+
                        max := int32(0) // latest store dependency
                        argsdone := true
                        for _, a := range w.Args {
diff --git a/test/fixedbugs/issue26105.go b/test/fixedbugs/issue26105.go
deleted file mode 100644 (file)
index 88a5f16..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// compile
-
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Triggers a bug in writebarrier, which inserts one
-// between (first block) OpAddr x and (second block) a VarDef x,
-// which are then in the wrong order and unable to be
-// properly scheduled.
-
-package q
-
-var S interface{}
-
-func F(n int) {
-       fun := func(x int) int {
-               S = 1
-               return n
-       }
-       i := fun(([]int{})[n])
-
-       var fc [2]chan int
-       S = (([1][2]chan int{fc})[i][i])
-}