]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: convert race cleanup rule to typed aux
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 24 Apr 2020 06:11:08 +0000 (23:11 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 24 Apr 2020 23:12:43 +0000 (23:12 +0000)
Passes toolstash-check.

Change-Id: I3005210cc156d01a6ac1ccaafb4311c607681bf0
Reviewed-on: https://go-review.googlesource.com/c/go/+/229691
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewritegeneric.go

index 7ab2013117b6a5e2ad61946ba42d3da14299048c..328585bbb6ad5ca60e690b017f5371add822a07b 100644 (file)
                                (Store {t5} (OffPtr <tt5> [o5] dst) d4
                                        (Zero {t1} [n] dst mem)))))
 
-(StaticCall {sym} x) && needRaceCleanup(sym,v) -> x
+(StaticCall {sym} x) && needRaceCleanup(sym, v) => x
 
 // Collapse moving A -> B -> C into just A -> C.
 // Later passes (deadstore, elim unread auto) will remove the A -> B move, if possible.
index 87d6195b6281789425a63b650a33e2baf43d3df0..0522a955dd5471fdef499732e4d963d725b7b497 100644 (file)
@@ -1340,12 +1340,12 @@ func registerizable(b *Block, typ *types.Type) bool {
 }
 
 // needRaceCleanup reports whether this call to racefuncenter/exit isn't needed.
-func needRaceCleanup(sym interface{}, v *Value) bool {
+func needRaceCleanup(sym Sym, v *Value) bool {
        f := v.Block.Func
        if !f.Config.Race {
                return false
        }
-       if !isSameSym(sym, "runtime.racefuncenter") && !isSameSym(sym, "runtime.racefuncexit") {
+       if !symNamed(sym, "runtime.racefuncenter") && !symNamed(sym, "runtime.racefuncexit") {
                return false
        }
        for _, b := range f.Blocks {
index 2d9f73da0936e2093dbde80c9c2053c239366c0f..d0f6363d13a15cb39fad294a387a84ae8c371042 100644 (file)
@@ -21128,10 +21128,10 @@ func rewriteValuegeneric_OpStaticCall(v *Value) bool {
                return true
        }
        // match: (StaticCall {sym} x)
-       // cond: needRaceCleanup(sym,v)
+       // cond: needRaceCleanup(sym, v)
        // result: x
        for {
-               sym := v.Aux
+               sym := auxToSym(v.Aux)
                x := v_0
                if !(needRaceCleanup(sym, v)) {
                        break