• Matthew Dempsky's avatar
    cmd/compile: insert instrumentation during SSA building · 17df5ed9
    Matthew Dempsky authored
    Insert appropriate race/msan calls before each memory operation during
    SSA construction.
    
    This is conceptually simple, but subtle because we need to be careful
    that inserted instrumentation calls don't clobber arguments that are
    currently being prepared for a user function call.
    
    reorder1 already handles introducing temporary variables for arguments
    in some cases. This CL changes it to use them for all arguments when
    instrumenting.
    
    Also, we can't SSA struct types with more than one field while
    instrumenting. Otherwise, concurrent uses of disjoint fields within an
    SSA-able struct can introduce false races.
    
    This is both somewhat better and somewhat worse than the old racewalk
    instrumentation pass. We're now able to easily recognize cases like
    constructing non-escaping closures on the stack or accessing closure
    variables don't need instrumentation calls. On the other hand,
    spilling escaping parameters to the heap now results in an
    instrumentation call.
    
    Overall, this CL results in a small net reduction in the number of
    instrumentation calls, but a small net increase in binary size for
    instrumented executables. cmd/go ends up with 5.6% fewer calls, but a
    2.4% larger binary.
    
    Fixes #19054.
    
    Change-Id: I70d1dd32ad6340e6fdb691e6d5a01452f58e97f3
    Reviewed-on: https://go-review.googlesource.com/102817Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    17df5ed9
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
cmd Loading commit data...
compress Loading commit data...
container Loading commit data...
context Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
internal Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
plugin Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
vendor/golang_org/x Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
androidtest.bash Loading commit data...
bootstrap.bash Loading commit data...
buildall.bash Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
cmp.bash Loading commit data...
iostest.bash Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
naclmake.bash Loading commit data...
nacltest.bash Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...