cmd/compile: eliminate OASWB

Instead we can just call needwritebarrier when constructing the SSA
representation.

Change-Id: I6fefaad49daada9cdb3050f112889e49dca0047b
Reviewed-on: https://go-review.googlesource.com/34566
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Matthew Dempsky 2016-12-19 10:30:44 -08:00
parent e7ec06e000
commit bdb9b945b9
11 changed files with 17 additions and 40 deletions

View file

@ -752,11 +752,6 @@ func fixedlit(ctxt initContext, kind initKind, n *Node, var_ *Node, init *Nodes)
switch kind {
case initKindStatic:
a = walkexpr(a, init) // add any assignments in r to top
if a.Op == OASWB {
// Static initialization never needs
// write barriers.
a.Op = OAS
}
if a.Op != OAS {
Fatalf("fixedlit: not as, is %v", a)
}