• Keith Randall's avatar
    cmd/compile: add x.Uses==1 test to load combiners · cd85f711
    Keith Randall authored
    We need to make sure that when we combine loads, we only do
    so if there are no other uses of the load.  We can't split
    one load into two because that can then lead to inconsistent
    loaded values in the presence of races.
    
    Add some aggressive copy removal code so that phantom
    "dead copy" uses of values are cleaned up promptly.  This lets
    us use x.Uses==1 conditions reliably.
    
    Change-Id: I9037311db85665f3868dbeb3adb3de5c20728b38
    Reviewed-on: https://go-review.googlesource.com/21853Reviewed-by: 's avatarTodd Neal <todd@tneal.org>
    cd85f711
rewrite.go 7.93 KB