[PGO] Refactor Value Profiling into a plugin based oracle and create a well defined...
authorBardia Mahjour <bmahjour@ca.ibm.com>
Thu, 3 Oct 2019 14:20:50 +0000 (14:20 +0000)
committerBardia Mahjour <bmahjour@ca.ibm.com>
Thu, 3 Oct 2019 14:20:50 +0000 (14:20 +0000)
commitf6c34de11767fce0c6503925bcef7228f36c6842
tree16c3957ff546c5ce548bf0bc2a982c229a583b78
parentf21dbcca90bcc823251240077addad7a2b2d193d
[PGO] Refactor Value Profiling into a plugin based oracle and create a well defined API for the plugins.

Summary: This PR creates a utility class called ValueProfileCollector that tells PGOInstrumentationGen and PGOInstrumentationUse what to value-profile and where to attach the profile metadata. It then refactors logic scattered in PGOInstrumentation.cpp into two plugins that plug into the ValueProfileCollector.

Authored By: Wael Yehia <wyehia@ca.ibm.com>

Reviewer: davidxl, tejohnson, xur

Reviewed By: davidxl, tejohnson, xur

Subscribers: llvm-commits

Tag: #llvm

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

Patch By Wael Yehia <wyehia@ca.ibm.com>

llvm-svn: 373601
llvm/lib/Transforms/Instrumentation/CMakeLists.txt
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
llvm/lib/Transforms/Instrumentation/ValueProfileCollector.cpp [new file with mode: 0644]
llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h [new file with mode: 0644]
llvm/lib/Transforms/Instrumentation/ValueProfilePlugins.inc [new file with mode: 0644]