[compiler-rt] [Profile] Refactor profile correlation. (PR #69656)
Zequan Wu via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 25 09:12:27 PDT 2023
================
@@ -24,15 +24,38 @@
using namespace llvm;
-/// Get the __llvm_prf_cnts section.
-Expected<object::SectionRef> getCountersSection(const object::ObjectFile &Obj) {
+namespace llvm {
+// Deprecated. Use -profile-correlate=debug-info.
+cl::opt<bool> DebugInfoCorrelate(
+ "debug-info-correlate",
+ cl::desc("Use debug info to correlate profiles (Deprecated). Use "
+ "-profile-correlate=debug-info instead."),
+ cl::init(false));
+
+cl::opt<InstrProfCorrelator::ProfCorrelatorKind> ProfileCorrelate(
+ "profile-correlate",
+ cl::desc("Use debug info or binary file to correlate profiles."),
+ cl::init(InstrProfCorrelator::NONE),
+ cl::values(clEnumValN(InstrProfCorrelator::NONE, "",
+ "No profile correlation"),
+ clEnumValN(InstrProfCorrelator::DEBUG_INFO, "debug-info",
+ "Use debug info to correlate")));
----------------
ZequanWu wrote:
No, if I kept ProfileCorrelate option in `InstrProfiling.cpp` but used it in`TargetLoweringObjectFileImpl.cpp` for binary correlation (#69493) will cause linking error when linking `unittests/Target/PowerPC/PowerPCTests`.
Yeah, we can keep `DebugInfoCorrelate` option in `InstrProfiling.cpp` but I think put them together makes it easier to understand `-debug-info-correlate` is an alias of `-profile-correlate=binary` and will be deprecated later.
https://github.com/llvm/llvm-project/pull/69656
More information about the llvm-commits
mailing list