aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringBase.cpp
diff options
context:
space:
mode:
authorCalixte Denizet <calixte.denizet@gmail.com>2020-02-10 18:46:37 +0100
committerCalixte Denizet <calixte.denizet@gmail.com>2020-02-24 10:38:33 +0100
commit8f46269f0c1cc93b080931fd9dfeffc4d364004b (patch)
tree8db06bfe3cbb4033dd4ba72cbf4eb2928f83ab90 /llvm/lib/CodeGen/TargetLoweringBase.cpp
parent9b23024c8b5d29d352215cc2e78eb1522f82a340 (diff)
downloadllvm-8f46269f0c1cc93b080931fd9dfeffc4d364004b.zip
llvm-8f46269f0c1cc93b080931fd9dfeffc4d364004b.tar.gz
llvm-8f46269f0c1cc93b080931fd9dfeffc4d364004b.tar.bz2
[profile] Don't dump counters when forking and don't reset when calling exec** functions
Summary: There is no need to write out gcdas when forking because we can just reset the counters in the parent process. Let say a counter is N before the fork, then fork and this counter is set to 0 in the child process. In the parent process, the counter is incremented by P and in the child process it's incremented by C. When dump is ran at exit, parent process will dump N+P for the given counter and the child process will dump 0+C, so when the gcdas are merged the resulting counter will be N+P+C. About exec** functions, since the current process is replaced by an another one there is no need to reset the counters but just write out the gcdas since the counters are definitely lost. To avoid to have lists in a bad state, we just lock them during the fork and the flush (if called explicitely) and lock them when an element is added. Reviewers: marco-c Reviewed By: marco-c Subscribers: hiraditya, cfe-commits, #sanitizers, llvm-commits, sylvestre.ledru Tags: #clang, #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D74953
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
0 files changed, 0 insertions, 0 deletions