https://github.com/ZequanWu edited
https://github.com/llvm/llvm-project/pull/69493
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/MaskRay commented:
The comment `The data and names sections are omitted in lightweight mode.` in
compiler-rt should be updated since binary correlation is different from the
lightweight mode
https://github.com/llvm/llvm-project/pull/69493
@@ -1331,6 +1336,18 @@ static int merge_main(int argc, const char *argv[]) {
"(default: 1)"));
cl::ParseCommandLineOptions(argc, argv, "LLVM profile data merger\n");
+ if (!DebugInfoFilename.empty() && !BinaryFilename.empty()) {
+
@@ -1829,6 +1833,22 @@ void CoverageMappingModuleGen::emit() {
llvm::GlobalValue::InternalLinkage, NamesArrVal,
llvm::getCoverageUnusedNamesVarName());
}
+ const StringRef
ZequanWu wrote:
> > > > This should works with PGO when value profiling is disabled
> > >
> > >
> > > Is this not compatible with value profiling? or just not implemented yet?
> >
> >
> > Not compatible, but this feature is mainly for coverage testing.
>
> Ok, not a big deal as it's
@@ -60,10 +60,7 @@ using namespace llvm;
#define DEBUG_TYPE "instrprof"
namespace llvm {
-cl::opt
-DebugInfoCorrelate("debug-info-correlate",
- cl::desc("Use debug info to correlate profiles."),
- cl::init(false));
WenleiHe wrote:
> > > This should works with PGO when value profiling is disabled
> >
> >
> > Is this not compatible with value profiling? or just not implemented yet?
>
> Not compatible, but this feature is mainly for coverage testing.
Ok, not a big deal as it's probably not worth the
david-xl wrote:
> > This should works with PGO when value profiling is disabled
>
> Is this not compatible with value profiling? or just not implemented yet?
Not compatible, but this feature is mainly for coverage testing.
https://github.com/llvm/llvm-project/pull/69493
@@ -98,13 +99,16 @@ extern cl::opt PrintPipelinePasses;
static cl::opt ClSanitizeOnOptimizerEarlyEP(
"sanitizer-early-opt-ep", cl::Optional,
cl::desc("Insert sanitizers on OptimizerEarlyEP."), cl::init(false));
-}
+
+extern cl::opt ProfileCorrelate;
@@ -98,13 +99,16 @@ extern cl::opt PrintPipelinePasses;
static cl::opt ClSanitizeOnOptimizerEarlyEP(
"sanitizer-early-opt-ep", cl::Optional,
cl::desc("Insert sanitizers on OptimizerEarlyEP."), cl::init(false));
-}
+
+extern cl::opt ProfileCorrelate;
ZequanWu wrote:
> > I think there should be a proper Clang flag to control this, instead of
> > requiring users to pass internal `-mllvm` flags. (Also the flag should be
> > well documented.)
>
> I believe Zequan did that at one point, but he ran into the problem that Rust
> and Clang need
@@ -540,10 +540,10 @@ Error RawInstrProfReader::readHeader(
"\nPLEASE update this tool to version in the raw profile, or
"
"regenerate raw profile with expected version.")
.str());
- if (useDebugInfoCorrelate() &&
@@ -61,9 +64,20 @@ uint64_t __llvm_profile_get_num_data(const
__llvm_profile_data *Begin,
COMPILER_RT_VISIBILITY
uint64_t __llvm_profile_get_data_size(const __llvm_profile_data *Begin,
const __llvm_profile_data *End) {
+ if
@@ -259,19 +259,19 @@ lprofWriteDataImpl(ProfDataWriter *Writer, const
__llvm_profile_data *DataBegin,
const char *CountersBegin, const char *CountersEnd,
VPDataReaderType *VPDataReader, const char *NamesBegin,
const
@@ -61,9 +64,20 @@ uint64_t __llvm_profile_get_num_data(const
__llvm_profile_data *Begin,
COMPILER_RT_VISIBILITY
uint64_t __llvm_profile_get_data_size(const __llvm_profile_data *Begin,
const __llvm_profile_data *End) {
+ if
@@ -267,6 +267,9 @@ uint64_t __llvm_profile_get_num_data(const
__llvm_profile_data *Begin,
uint64_t __llvm_profile_get_data_size(const __llvm_profile_data *Begin,
const __llvm_profile_data *End);
+/*! \brief Get the size of the profile
@@ -66,8 +66,9 @@ int __llvm_profile_check_compatibility(const char
*ProfileData,
Header->NumCounters !=
__llvm_profile_get_num_counters(__llvm_profile_begin_counters(),
__llvm_profile_end_counters()) ||
-
@@ -374,6 +376,14 @@ class RawInstrProfReader : public InstrProfReader {
return (Version & VARIANT_MASK_DBG_CORRELATE) != 0;
}
+ bool useBinaryCorrelate() const override {
+return (Version & VARIANT_MASK_BIN_CORRELATE) != 0;
+ }
+
+ bool useCorrelate() const {
@@ -98,13 +99,16 @@ extern cl::opt PrintPipelinePasses;
static cl::opt ClSanitizeOnOptimizerEarlyEP(
"sanitizer-early-opt-ep", cl::Optional,
cl::desc("Insert sanitizers on OptimizerEarlyEP."), cl::init(false));
-}
+
+extern cl::opt ProfileCorrelate;
rnk wrote:
> I think there should be a proper Clang flag to control this, instead of
> requiring users to pass internal `-mllvm` flags. (Also the flag should be
> well documented.)
I believe Zequan did that at one point, but he ran into the problem that Rust
and Clang need to agree on the
https://github.com/zmodem commented:
I think there should be a proper Clang flag to control this, instead of
requiring users to pass internal `-mllvm` flags. (Also the flag should be well
documented.)
https://github.com/llvm/llvm-project/pull/69493
@@ -60,10 +60,7 @@ using namespace llvm;
#define DEBUG_TYPE "instrprof"
namespace llvm {
-cl::opt
-DebugInfoCorrelate("debug-info-correlate",
- cl::desc("Use debug info to correlate profiles."),
- cl::init(false));
david-xl wrote:
Can you send a RFC for this enhancement ? The first 2 paragraph of this PR can
be expanded a little more to show motivations (RAM saving, or raw profile size
saving and why) and the savings data.
https://github.com/llvm/llvm-project/pull/69493
@@ -0,0 +1,11 @@
+; RUN: opt < %s -passes=instrprof -profile-correlate=binary -S | FileCheck %s
+
+; CHECK: @__profd_foo = private global { i64, i64, i64, ptr, ptr, i32, [2 x
i16] } { i64 {{.*}}, i64 {{.*}}, i64 ptrtoint (ptr @__profc_foo to i64)
ZequanWu wrote:
https://github.com/ZequanWu updated
https://github.com/llvm/llvm-project/pull/69493
>From 3a394ce5d4d7d91251337bd0a2c1c1a074eb37e6 Mon Sep 17 00:00:00 2001
From: Zequan Wu
Date: Tue, 17 Oct 2023 19:24:12 -0400
Subject: [PATCH 1/5] [Profile] Add binary profile correlation.
---
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff c9b7d21dc577b10dce2b8d67b86b279cfc374d40
c5cca07062572077c4140b4eb9a4bdbb22a385a6 --
https://github.com/ZequanWu edited
https://github.com/llvm/llvm-project/pull/69493
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Zequan Wu (ZequanWu)
Changes
This is similar to debug info correlation. The motivation is that debug info
correlation doesn't work on Windows because it's hard to make codeview contains
those artificial debug info.
The idea is to
https://github.com/ZequanWu created
https://github.com/llvm/llvm-project/pull/69493
This is similar to debug info correlation. The motivation is that debug info
correlation doesn't work on Windows because it's hard to make codeview contains
those artificial debug info.
The idea is to
29 matches
Mail list logo