[PATCH] D19293: [profile] LLVM support for memory-mapping profile counters
David Li via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 19 16:16:21 PDT 2016
davidxl added inline comments.
================
Comment at: lib/ProfileData/InstrProfReader.cpp:288
@@ +287,3 @@
+ // occurs when memory-mapping tightly packed sections into the profile.
+ for (; CurrentPos + sizeof(RawInstrProf::Header) <= End;
+ CurrentPos += sizeof(uint64_t)) {
----------------
Using the for-loop and pattern matching Magic seems weird. Can the paddings be zero filled?
================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:390
@@ -385,1 +389,3 @@
+void InstrProfiling::emitCounterPadding() {
+ auto PageSize = llvm::sys::Process::getPageSize();
----------------
Should this be conditionally emitted for darwin only?
Also do you need to emit this padding bytes per module? Have you considered using linker script to do that?
http://reviews.llvm.org/D19293
More information about the llvm-commits
mailing list