]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal: decouple scope tracking from location lists
authorHeschi Kreinick <heschi@google.com>
Tue, 23 Jan 2018 19:10:08 +0000 (14:10 -0500)
committerHeschi Kreinick <heschi@google.com>
Wed, 14 Feb 2018 18:29:18 +0000 (18:29 +0000)
We're trying to enable location lists by default, and it's easier to do
that if we don't have to worry about scope tracking at the same time.
We can evaluate their performance impact separately.

However, that does mean that "err" is ambiguous in the test case, so
rename it to err2 for now.

Change-Id: I24f119016185c52b7d9affc74207f6a5b450fb6f
Reviewed-on: https://go-review.googlesource.com/89355
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/ssa/testdata/hist.gdb-dbg.nexts
src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts
src/cmd/compile/internal/ssa/testdata/hist.go

index 802e02896de59f59f8b69746ceef3fa8b14633bf..79017d2721a9238739c9334b99987a6876454ed8 100644 (file)
@@ -405,7 +405,7 @@ func Main(archInit func(*Arch)) {
                Debug['l'] = 1 - Debug['l']
        }
 
-       trackScopes = flagDWARF && ((Debug['l'] == 0 && Debug['N'] != 0) || Ctxt.Flag_locationlists)
+       trackScopes = flagDWARF && (Debug['l'] == 0 && Debug['N'] != 0)
 
        Widthptr = thearch.LinkArch.PtrSize
        Widthreg = thearch.LinkArch.RegSize
index fe000147bde4f07bc243aefd55703aab13606bcf..91b4f2d23f5a4b204bfb5d457bcf9f9234b19061 100644 (file)
@@ -14,64 +14,64 @@ hist =  []int = {0, 0, 0, 0, 0, 0, 0}
 73:            scanner := bufio.NewScanner(reader)
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
 i = 1
 81:                    hist = ensure(int(i), hist)
 82:                    hist[int(i)]++
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
 i = 1
 81:                    hist = ensure(int(i), hist)
 82:                    hist[int(i)]++
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
 i = 1
 81:                    hist = ensure(int(i), hist)
 82:                    hist[int(i)]++
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
 i = 2
 81:                    hist = ensure(int(i), hist)
 82:                    hist[int(i)]++
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
 i = 2
 81:                    hist = ensure(int(i), hist)
 82:                    hist[int(i)]++
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
 i = 2
 81:                    hist = ensure(int(i), hist)
 82:                    hist[int(i)]++
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
 i = 4
 81:                    hist = ensure(int(i), hist)
 82:                    hist[int(i)]++
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
 i = 4
 81:                    hist = ensure(int(i), hist)
 82:                    hist[int(i)]++
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
 i = 5
 81:                    hist = ensure(int(i), hist)
 82:                    hist[int(i)]++
index e4dc2808694a5225b8518bc02126e9940d7c32ae..9ca178492a4583af4c446bc6d77830fc965b6c76 100644 (file)
@@ -22,9 +22,9 @@ dy = <Optimized out, as expected>
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 scanner = (struct bufio.Scanner *) <A>
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
-err = {tab = 0x0, data = 0x0}
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
+err2 = {tab = 0x0, data = 0x0}
 hist =  []int = {0, 0, 0, 0, 0, 0, 0}
 i = 1
 81:                    hist = ensure(int(i), hist)
@@ -32,9 +32,9 @@ i = 1
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 scanner = (struct bufio.Scanner *) <A>
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
-err = {tab = 0x0, data = 0x0}
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
+err2 = {tab = 0x0, data = 0x0}
 hist =  []int = {0, 1, 0, 0, 0, 0, 0}
 i = 1
 81:                    hist = ensure(int(i), hist)
@@ -42,9 +42,9 @@ i = 1
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 scanner = (struct bufio.Scanner *) <A>
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
-err = {tab = 0x0, data = 0x0}
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
+err2 = {tab = 0x0, data = 0x0}
 hist =  []int = {0, 2, 0, 0, 0, 0, 0}
 i = 1
 81:                    hist = ensure(int(i), hist)
@@ -52,9 +52,9 @@ i = 1
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 scanner = (struct bufio.Scanner *) <A>
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
-err = {tab = 0x0, data = 0x0}
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
+err2 = {tab = 0x0, data = 0x0}
 hist =  []int = {0, 3, 0, 0, 0, 0, 0}
 i = 2
 81:                    hist = ensure(int(i), hist)
@@ -62,9 +62,9 @@ i = 2
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 scanner = (struct bufio.Scanner *) <A>
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
-err = {tab = 0x0, data = 0x0}
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
+err2 = {tab = 0x0, data = 0x0}
 hist =  []int = {0, 3, 1, 0, 0, 0, 0}
 i = 2
 81:                    hist = ensure(int(i), hist)
@@ -72,9 +72,9 @@ i = 2
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 scanner = (struct bufio.Scanner *) <A>
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
-err = {tab = 0x0, data = 0x0}
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
+err2 = {tab = 0x0, data = 0x0}
 hist =  []int = {0, 3, 2, 0, 0, 0, 0}
 i = 2
 81:                    hist = ensure(int(i), hist)
@@ -82,9 +82,9 @@ i = 2
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 scanner = (struct bufio.Scanner *) <A>
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
-err = {tab = 0x0, data = 0x0}
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
+err2 = {tab = 0x0, data = 0x0}
 hist =  []int = {0, 3, 3, 0, 0, 0, 0}
 i = 4
 81:                    hist = ensure(int(i), hist)
@@ -92,9 +92,9 @@ i = 4
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 scanner = (struct bufio.Scanner *) <A>
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
-err = {tab = 0x0, data = 0x0}
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
+err2 = {tab = 0x0, data = 0x0}
 hist =  []int = {0, 3, 3, 0, 1, 0, 0}
 i = 4
 81:                    hist = ensure(int(i), hist)
@@ -102,9 +102,9 @@ i = 4
 74:            for scanner.Scan() { //gdb-opt=(scanner/A)
 scanner = (struct bufio.Scanner *) <A>
 75:                    s := scanner.Text()
-76:                    i, err := strconv.ParseInt(s, 10, 64)
-77:                    if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
-err = {tab = 0x0, data = 0x0}
+76:                    i, err2 := strconv.ParseInt(s, 10, 64)
+77:                    if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
+err2 = {tab = 0x0, data = 0x0}
 hist =  []int = {0, 3, 3, 0, 2, 0, 0}
 i = 5
 81:                    hist = ensure(int(i), hist)
index 8a0cc2728081abee0f54c47e2414a42c0fac5cba..1462ff64dec9a95f4af32d0e9c5cf48bf494d1e9 100644 (file)
@@ -73,9 +73,9 @@ func test() {
        scanner := bufio.NewScanner(reader)
        for scanner.Scan() { //gdb-opt=(scanner/A)
                s := scanner.Text()
-               i, err := strconv.ParseInt(s, 10, 64)
-               if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
-                       fmt.Fprintf(os.Stderr, "There was an error: %v\n", err)
+               i, err2 := strconv.ParseInt(s, 10, 64)
+               if err2 != nil { //gdb-dbg=(i) //gdb-opt=(err2,hist,i)
+                       fmt.Fprintf(os.Stderr, "There was an error: %v\n", err2)
                        return
                }
                hist = ensure(int(i), hist)