[PATCH] D12781: PGO IR-level instrumentation infrastructure

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 11:00:05 PST 2015


xur updated this revision to Diff 39382.
xur added a comment.

Here is the updated patch that integrated David and Sean's comments and suggestions. The major changes are:

- move profile reader to module level.
- move minimum spanning tree into a utility class.
- separate profile generate and use into to two separated passes.
- use static profile to set the edge weights.
- move the code that can be shared with clang instrumentation to include/llvm/Transforms/Instrumentation.h as utility functions.
- name change (using IR instrumentation now)
- move InstrProfWrite to a later patch.

I did not use ReversePostOrderTraversal in ADT/PostOrderiterator.h (David suggested) as compared to current version, it leads to more passes to populate the counters.

I think it is better to separate this IR level instrumentation from FE code, to avoid code duplication for other language frond-ends. So I keep to pass the file name instead of IndexedInstrProfRead to llvm. The error checking is already well encapsulated in getFunctioncounts() and ProfReader(). I kept it in middle end too.

I will add unit tests for both minimum spanning tree and IR instrumentation later.


http://reviews.llvm.org/D12781

Files:
  include/llvm/IR/DiagnosticInfo.h
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  include/llvm/Support/CFGMST.h
  include/llvm/Transforms/IPO/PassManagerBuilder.h
  include/llvm/Transforms/Instrumentation.h
  lib/IR/DiagnosticInfo.cpp
  lib/Transforms/IPO/LLVMBuild.txt
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Instrumentation/CMakeLists.txt
  lib/Transforms/Instrumentation/Instrumentation.cpp
  lib/Transforms/Instrumentation/LLVMBuild.txt
  lib/Transforms/Instrumentation/PGOIRInstr.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12781.39382.patch
Type: text/x-patch
Size: 47635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151105/f780f8f3/attachment-0001.bin>


More information about the llvm-commits mailing list