Commit Graph

6 Commits

Author SHA1 Message Date
Manman Ren e73ae9a142 Reland compiler-rt support for order file instrumentation.
r355343 was landed and was reverted in r355363 due to build breakage.
This patch adds Linux/Windows support on top of r355343.

In this patch, Darwin should be working with testing case. Linux should be working,
I will enable the testing case in a follwup diff. Windows/Other should be building.
Correct implementation for Other platforms will be added.

Thanks David for reviewing the original diff, helping me with issues on Linux, and
giving suggestions for adding support for Other platforms.

llvm-svn: 355701
2019-03-08 15:30:56 +00:00
Manman Ren ff4bb36d7c Revert compiler-rt diffs for order file instrumentation to get bot green!
This caused issues on Linux/Windows and other platforms.

r355343 355350 355350

llvm-svn: 355363
2019-03-05 01:21:40 +00:00
Manman Ren 31b31e5111 Attemp to fix windows profile-rt build breakage.
Followup to D57530.

llvm-svn: 355357
2019-03-05 00:52:00 +00:00
Manman Ren 03d5348132 Attemp to fix build brokage due to D57530.
By adding implementations for __llvm_profile_begin_orderfile for non-Darwin platforms.

llvm-svn: 355350
2019-03-04 23:41:57 +00:00
Reid Kleckner 8b6af00173 [llvm-cov] Fix llvm-cov on Windows and un-XFAIL test
Summary:
The llvm-cov tool needs to be able to find coverage names in the
executable, so the .lprfn and .lcovmap sections cannot be merged into
.rdata.

Also, the linker merges .lprfn$M into .lprfn, so llvm-cov needs to
handle that when looking up sections. It has to support running on both
relocatable object files and linked PE files.

Lastly, when loading .lprfn from a PE file, llvm-cov needs to skip the
leading zero byte added by the profile runtime.

Reviewers: vsk

Subscribers: hiraditya, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 354840
2019-02-26 02:30:00 +00:00
Reid Kleckner 987d331fab [InstrProf] Implement static profdata registration
Summary:
The motivating use case is eliminating duplicate profile data registered
for the same inline function in two object files. Before this change,
users would observe multiple symbol definition errors with VC link, but
links with LLD would succeed.

Users (Mozilla) have reported that PGO works well with clang-cl and LLD,
but when using LLD without this static registration, we would get into a
"relocation against a discarded section" situation. I'm not sure what
happens in that situation, but I suspect that duplicate, unused profile
information was retained. If so, this change will reduce the size of
such binaries with LLD.

Now, Windows uses static registration and is in line with all the other
platforms.

Reviewers: davidxl, wmi, inglorion, void, calixte

Subscribers: mgorny, krytarowski, eraman, fedor.sergeev, hiraditya, #sanitizers, dmajor, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 353547
2019-02-08 19:03:50 +00:00