Skip to content

Commit b0a8754

Browse files
committed
cmd/compile: convert race cleanup rule to typed aux
Passes toolstash-check. Change-Id: I3005210cc156d01a6ac1ccaafb4311c607681bf0 Reviewed-on: https://go-review.googlesource.com/c/go/+/229691 Reviewed-by: Keith Randall <[email protected]>
1 parent 32467e6 commit b0a8754

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/cmd/compile/internal/ssa/gen/generic.rules

+1-1
Original file line numberDiff line numberDiff line change
@@ -2391,7 +2391,7 @@
23912391
(Store {t5} (OffPtr <tt5> [o5] dst) d4
23922392
(Zero {t1} [n] dst mem)))))
23932393

2394-
(StaticCall {sym} x) && needRaceCleanup(sym,v) -> x
2394+
(StaticCall {sym} x) && needRaceCleanup(sym, v) => x
23952395

23962396
// Collapse moving A -> B -> C into just A -> C.
23972397
// Later passes (deadstore, elim unread auto) will remove the A -> B move, if possible.

src/cmd/compile/internal/ssa/rewrite.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1340,12 +1340,12 @@ func registerizable(b *Block, typ *types.Type) bool {
13401340
}
13411341

13421342
// needRaceCleanup reports whether this call to racefuncenter/exit isn't needed.
1343-
func needRaceCleanup(sym interface{}, v *Value) bool {
1343+
func needRaceCleanup(sym Sym, v *Value) bool {
13441344
f := v.Block.Func
13451345
if !f.Config.Race {
13461346
return false
13471347
}
1348-
if !isSameSym(sym, "runtime.racefuncenter") && !isSameSym(sym, "runtime.racefuncexit") {
1348+
if !symNamed(sym, "runtime.racefuncenter") && !symNamed(sym, "runtime.racefuncexit") {
13491349
return false
13501350
}
13511351
for _, b := range f.Blocks {

src/cmd/compile/internal/ssa/rewritegeneric.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)