llvm-project/llvm/test/Instrumentation/SanitizerCoverage
Leonard Chan eca01b031d [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes
This patch merges the sancov module and funciton passes into one module pass.

The reason for this is because we ran into an out of memory error when
attempting to run asan fuzzer on some protobufs (pc.cc files). I traced the OOM
error to the destructor of SanitizerCoverage where we only call
appendTo[Compiler]Used which calls appendToUsedList. I'm not sure where precisely
in appendToUsedList causes the OOM, but I am able to confirm that it's calling
this function *repeatedly* that causes the OOM. (I hacked sancov a bit such that
I can still create and destroy a new sancov on every function run, but only call
appendToUsedList after all functions in the module have finished. This passes, but
when I make it such that appendToUsedList is called on every sancov destruction,
we hit OOM.)

I don't think the OOM is from just adding to the SmallSet and SmallVector inside
appendToUsedList since in either case for a given module, they'll have the same
max size. I suspect that when the existing llvm.compiler.used global is erased,
the memory behind it isn't freed. I could be wrong on this though.

This patch works around the OOM issue by just calling appendToUsedList at the
end of every module run instead of function run. The same amount of constants
still get added to llvm.compiler.used, abd we make the pass usage and logic
simpler by not having any inter-pass dependencies.

Differential Revision: https://reviews.llvm.org/D66988

llvm-svn: 370971
2019-09-04 20:30:29 +00:00
..
abort-in-entry-block.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
backedge-pruning.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
chains.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
cmp-tracing-api-x86_32.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
cmp-tracing-api-x86_64.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
cmp-tracing.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
coff-comdat.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
coff-pc-table-inline-8bit-counters.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
coff-used-ctor.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
const-cmp-tracing.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
coverage-dbg.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
coverage.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
coverage2-dbg.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
div-tracing.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
gep-tracing.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
inline-8bit-counters.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
interposable-symbol-nocomdat.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
no-func.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
pc-table.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
postdominator_check.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
seh.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
stack-depth-variable-declared-by-user.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
stack-depth.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
switch-tracing.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
trace-pc-guard-comdat.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
trace-pc-guard-inline-8bit-counters.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
trace-pc-guard-nocomdat.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
tracing-comdat.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
tracing.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
unreachable-critedge.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
wineh.ll [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00