• Matthew Dempsky's avatar
    cmd/compile: allow SSA of multi-field structs while instrumenting · 736390c2
    Matthew Dempsky authored
    When we moved racewalk to buildssa, we disabled SSA of structs with
    2-4 fields while instrumenting because it caused false dependencies
    because for "x.f" we would emit
    
        (StructSelect (Load (Addr x)) "f")
    
    Even though we later simplify this to
    
        (Load (OffPtr (Addr x) "f"))
    
    the instrumentation saw a load of x in its entirety and would issue
    appropriate race/msan calls.
    
    The fix taken here is to directly emit the OffPtr form when x.f is
    addressable and can't be represented in SSA form.
    
    Change-Id: I0caf37bced52e9c16937466b0ac8cab6d356e525
    Reviewed-on: https://go-review.googlesource.com/109360
    Run-TryBot: Matthew Dempsky <mdempsky@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    736390c2
ssa.go 173 KB