Description
MemorySanitizer (MSan ) is a tool for detecting the use of uninitialized memory during
runtime. One of its major drawbacks is the significant slowdown in runtime: on average,
programs run 2.11 times slower with MSan . To improve MSan ’s performance, this thesis
examines its components to identify optimization opportunities. Four optimizations
are presented: three static analyses and one general optimization. All of these focus
on the MSan instrumentation. Two of the analyses identify instrumentation variables
in MSan that can be replaced with constants, which the compiler can then simplify.
The other two optimizations simplify MSan ’s instrumentation, reducing the number of
instructions MSan requires to detect errors in a program. One analysis reduces MSan ’s
slowdown by 0.7%, excluding one significant outlier. The most effective optimization
reduces MSan ’s average slowdown by 4.3% and speeds up programs by 3.8%, albeit at
the cost of more false positives. Otherwise, the slowdowns remain relatively unchanged.
The optimizations introduce no false negatives, though two can introduce new false
positives.
|