Changes from Git (git http://labmaster3.local/git/llvm-project.git)


  1. [profile] Support counter relocation at runtime (details)
Commit d3db13af7e5c01632fbf28149a2d4f9c4841aeba by phosek
[profile] Support counter relocation at runtime
This is an alternative to the continous mode that was implemented in
D68351. This mode relies on padding and the ability to mmap a file over
the existing mapping which is generally only available on POSIX systems
and isn't suitable for other platforms.
This change instead introduces the ability to relocate counters at
runtime using a level of indirection. On every counter access, we add a
bias to the counter address. This bias is stored in a symbol that's
provided by the profile runtime and is initially set to zero, meaning no
relocation. The runtime can mmap the profile into memory at abitrary
location, and set bias to the offset between the original and the new
counter location, at which point every subsequent counter access will be
to the new location, which allows updating profile directly akin to the
continous mode.
The advantage of this implementation is that doesn't require any special
OS support. The disadvantage is the extra overhead due to additional
instructions required for each counter access (overhead both in terms of
binary size and performance) plus duplication of counters (i.e. one copy
in the binary itself and another copy that's mmapped).
Differential Revision:
The file was addedcompiler-rt/test/profile/ContinuousSyncMode/runtime-counter-relocation.c
The file was modifiedclang/docs/SourceBasedCodeCoverage.rst
The file was modifiedcompiler-rt/lib/profile/InstrProfilingFile.c
The file was modifiedcompiler-rt/test/profile/ContinuousSyncMode/basic.c
The file was modifiedclang/lib/Driver/ToolChains/Darwin.cpp
The file was modifiedcompiler-rt/lib/profile/InstrProfilingBuffer.c
The file was modifiedcompiler-rt/lib/profile/InstrProfilingInternal.h
The file was modifiedcompiler-rt/test/profile/ContinuousSyncMode/online-merging.c
The file was addedllvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
The file was modifiedcompiler-rt/lib/profile/CMakeLists.txt
The file was modifiedcompiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
The file was modifiedcompiler-rt/test/profile/ContinuousSyncMode/pid-substitution.c
The file was addedcompiler-rt/lib/profile/InstrProfilingBiasVar.c
The file was modifiedllvm/include/llvm/ProfileData/InstrProf.h
The file was modifiedllvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
The file was modifiedcompiler-rt/test/profile/ContinuousSyncMode/multiple-DSOs.c
The file was modifiedcompiler-rt/test/profile/ContinuousSyncMode/set-filename.c
The file was removedcompiler-rt/test/profile/ContinuousSyncMode/
The file was modifiedllvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
The file was modifiedcompiler-rt/test/profile/ContinuousSyncMode/set-file-object.c
The file was modifiedcompiler-rt/lib/profile/InstrProfiling.h