[PATCH] D57463: Add a module pass for order file instrumentation

Manman Ren via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 30 09:53:06 PST 2019


manmanren created this revision.
manmanren added reviewers: davidxl, beanz, dexonsmith.
Herald added subscribers: llvm-commits, jfb, mgorny, mehdi_amini.

The basic idea of the pass is to use a circular buffer to log the execution ordering of the functions. We only log the function when it is first executed. We use a 8-byte hash to log the function symbol name.

In this pass, we add three global variables:
(1) an order file buffer: a circular buffer at its own llvm section.
(2) a bitmap for each module: one byte for each function to say if the function is already executed.
(3) a global index to the order file buffer.

At the function prologue, if the function has not been executed (by checking the bitmap), log the function hash, then atomically increase the index.


Repository:
  rL LLVM

https://reviews.llvm.org/D57463

Files:
  include/llvm/InitializePasses.h
  include/llvm/ProfileData/InstrProfData.inc
  include/llvm/Transforms/Instrumentation.h
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Instrumentation/CMakeLists.txt
  lib/Transforms/Instrumentation/InstrOrderFile.cpp
  lib/Transforms/Instrumentation/Instrumentation.cpp
  test/Instrumentation/InstrOrderFile/basic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57463.184316.patch
Type: text/x-patch
Size: 14203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190130/2a453890/attachment.bin>


More information about the llvm-commits mailing list