mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
2c53ec0c7b
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
24 lines
1.2 KiB
LLVM
24 lines
1.2 KiB
LLVM
; Test -sanitizer-coverage-trace-compares=1 API declarations on x86_64
|
|
; RUN: opt < %s -sancov -sanitizer-coverage-level=1 -sanitizer-coverage-trace-compares=1 -S | FileCheck %s
|
|
; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=1 -sanitizer-coverage-trace-compares=1 -S | FileCheck %s
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
define i32 @foo() #0 {
|
|
entry:
|
|
ret i32 0
|
|
}
|
|
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_pc_indir(i64)
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp1(i8 zeroext, i8 zeroext)
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp2(i16 zeroext, i16 zeroext)
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp4(i32 zeroext, i32 zeroext)
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_cmp8(i64, i64)
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_div4(i32 zeroext)
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_div8(i64)
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_gep(i64)
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_switch(i64, i64*)
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_pc()
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_pc_guard(i32*)
|
|
; CHECK-DAG: declare void @__sanitizer_cov_trace_pc_guard_init(i32*, i32*)
|
|
; CHECK-NOT: declare
|