• David Chase's avatar
    cmd/compile: add LocalAddr that takes SP,mem operands · 0029cd47
    David Chase authored
    Lack of a well-defined order between VarDef and related
    address operations sometimes causes problems with store order
    and write barrier transformations; glitches in the order are
    made irreparable (by later optimizations) if the two parts of
    the glitch straddle a split in the original block caused by
    insertion of a write barrier diamond.
    
    Fix this by creating a LocalAddr for addresses of locals
    (what VarDef matters for) that takes a memory input to
    help make the order explicit.  Addr is modified to only
    be legal for SB operand, so there is no overlap between
    Addr and LocalAddr uses (there may be some downstream
    cleanup from this).
    
    Changes to generic.rules and rewrite.go ensure that codegen
    tests continue to pass; CSE of LocalAddr is impaired, not
    quite sure of the cost.
    
    Fixes #26105.
    
    Change-Id: Id4192b4440aa4e9d7ba54a465c456df9b530b515
    Reviewed-on: https://go-review.googlesource.com/122483
    Run-TryBot: David Chase <drchase@google.com>
    Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    0029cd47
nilcheck.go 8.56 KB