[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][CodeGen]Introduce function address map section and emit dynamic instruction count(CodeGen part) (PR #124334)

2025-02-14 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124334 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][CodeGen]Introduce function address map section and emit dynamic instruction count(CodeGen part) (PR #124334)

2025-02-14 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124334 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][CodeGen]Introduce function address map section and emit dynamic instruction count(CodeGen part) (PR #124334)

2025-02-12 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124334 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][CodeGen]Introduce function address map section and emit dynamic instruction count(CodeGen part) (PR #124334)

2025-02-12 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124334 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [SHT_LLVM_FUNC_MAP][llvm-readobj]Introduce function address map section and emit dynamic instruction count(readobj part) (PR #124333)

2025-02-12 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124333 >From 0f1f43a5f19d4055c1896a70e050965b4d309790 Mon Sep 17 00:00:00 2001 From: wlei Date: Wed, 12 Feb 2025 22:03:21 -0800 Subject: [PATCH] remove irrelevant code Created using spr 1.3.6-beta.1 --- llvm/tools/

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][llvm-readobj]Introduce function address map section and emit dynamic instruction count(readobj part) (PR #124333)

2025-02-12 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124333 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][llvm-readobj]Introduce function address map section and emit dynamic instruction count(readobj part) (PR #124333)

2025-02-12 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124333 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [Draft] add func map section header (PR #125649)

2025-02-03 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/125649 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [TMP] add func map section header (PR #125649)

2025-02-03 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm created https://github.com/llvm/llvm-project/pull/125649 Test Plan: llvm/test/CodeGen/X86/function-address-map-function-sections.ll ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][CodeGen]Introduce function address map section and emit dynamic instruction count(CodeGen part) (PR #124334)

2025-01-27 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124334 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][CodeGen]Introduce function address map section and emit dynamic instruction count(CodeGen part) (PR #124334)

2025-01-27 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124334 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][CodeGen]Introduce function address map section and emit dynamic instruction count(CodeGen part) (PR #124334)

2025-01-27 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/124334 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][llvm-readobj]Introduce function address map section and emit dynamic instruction count(readobj part) (PR #124333)

2025-01-27 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124333 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][llvm-readobj]Introduce function address map section and emit dynamic instruction count(readobj part) (PR #124333)

2025-01-27 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/124333 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][llvm-readobj]Introduce function address map section and emit dynamic instruction count(readobj part) (PR #124333)

2025-01-27 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/124333 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][CodeGen]Introduce function address map section and emit dynamic instruction count(CodeGen part) (PR #124334)

2025-01-24 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm created https://github.com/llvm/llvm-project/pull/124334 Test Plan: llvm/test/CodeGen/X86/function-address-map-function-sections.ll ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.

[llvm-branch-commits] [SHT_LLVM_FUNC_MAP][llvm-readobj]Introduce function address map section and emit dynamic instruction count(readobj part) (PR #124333)

2025-01-24 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm created https://github.com/llvm/llvm-project/pull/124333 Test Plan: llvm/test/tools/llvm-readobj/ELF/func-map.test ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[Lldb-commits] [clang] [compiler-rt] [libc] [lld] [lldb] [llvm] [mlir] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-08 Thread Lei Wang via lldb-commits
wlei-llvm wrote: > > > > > > Ping @wlei-llvm > > > > > > > > > > > > > > > Sorry for the delay. The new version addressed my last comment (with > > > > > just minor nits). However, I didn't fully follow the new features > > > > > related to `ProbeMatchSpecs` stuffs. Could you add more descrip

[clang] [compiler-rt] [libc] [lld] [lldb] [llvm] [mlir] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-08 Thread Lei Wang via cfe-commits
wlei-llvm wrote: > > > > > > Ping @wlei-llvm > > > > > > > > > > > > > > > Sorry for the delay. The new version addressed my last comment (with > > > > > just minor nits). However, I didn't fully follow the new features > > > > > related to `ProbeMatchSpecs` stuffs. Could you add more descrip

[llvm-branch-commits] [llvm] [MC] Use StringRefs from pseudo_probe_desc section if it's mapped (PR #112996)

2024-11-08 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm approved this pull request. Sorry for the delay, LGTM. https://github.com/llvm/llvm-project/pull/112996 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [compiler-rt] [libc] [lld] [lldb] [llvm] [mlir] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-08 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm approved this pull request. LGTM, thanks for addressing the comments! https://github.com/llvm/llvm-project/pull/99891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[Lldb-commits] [clang] [compiler-rt] [libc] [lld] [lldb] [llvm] [mlir] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-08 Thread Lei Wang via lldb-commits
https://github.com/wlei-llvm approved this pull request. LGTM, thanks for addressing the comments! https://github.com/llvm/llvm-project/pull/99891 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [compiler-rt] [libc] [lld] [lldb] [llvm] [mlir] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-08 Thread Lei Wang via cfe-commits
wlei-llvm wrote: > > > > Ping @wlei-llvm > > > > > > > > > Sorry for the delay. The new version addressed my last comment (with just > > > minor nits). However, I didn't fully follow the new features related to > > > `ProbeMatchSpecs` stuffs. Could you add more descriptions to the diff > > >

[Lldb-commits] [clang] [compiler-rt] [libc] [lld] [lldb] [llvm] [mlir] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-08 Thread Lei Wang via lldb-commits
wlei-llvm wrote: > > > > Ping @wlei-llvm > > > > > > > > > Sorry for the delay. The new version addressed my last comment (with just > > > minor nits). However, I didn't fully follow the new features related to > > > `ProbeMatchSpecs` stuffs. Could you add more descriptions to the diff > > >

[clang] Reapply "[Clang][Sema] Always use latest redeclaration of primary template" (PR #114569)

2024-11-07 Thread Lei Wang via cfe-commits
wlei-llvm wrote: Hi, here is the reduced repro (not perfect, but was as far as I can get), thanks! ``` namespace std { template _Tp __declval(long); template auto declval() noexcept -> decltype(__declval<_Tp>(0)); template class __is_convertible_helper { template

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-06 Thread Lei Wang via llvm-branch-commits
@@ -447,12 +561,12 @@ createFlowFunction(const BinaryFunction::BasicBlockOrderType &BlockOrder) { /// of the basic blocks in the binary, the count is "matched" to the block. /// Similarly, if both the source and the target of a count in the profile are /// matched to a jump in

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-06 Thread Lei Wang via llvm-branch-commits
@@ -482,11 +596,68 @@ matchWeightsByHashes(BinaryContext &BC, << Twine::utohexstr(BB->getHash()) << "\n"); } StaleMatcher Matcher; + // Collects function pseudo probes for use in the StaleMatcher. + if (opts::StaleMatchingWithPseudoProbes) { +con

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-06 Thread Lei Wang via llvm-branch-commits
wlei-llvm wrote: > > Ping @wlei-llvm > > Sorry for the delay. The new version addressed my last comment (with just > minor nits). However, I didn't fully follow the new features related to > `ProbeMatchSpecs` stuffs. Could you add more descriptions to the diff > summary? Or if it’s not a lot

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-11-05 Thread Lei Wang via cfe-commits
wlei-llvm wrote: Hi @sdkrystian , FYI, we also hit an error/assertion that bisected to this https://github.com/llvm/llvm-project/pull/114569 ``` lvm-project/clang/lib/AST/ExprConstant.cpp:16601: bool clang::Expr::EvaluateAsConstantExpr(EvalResult &, const ASTContext &, ConstantExprKind) const

[clang] [llvm] [InstrPGO] Avoid using global variable to fix potential data race (PR #114364)

2024-10-31 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm closed https://github.com/llvm/llvm-project/pull/114364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Avoid using global variable to fix potential data race (PR #114364)

2024-10-31 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/114364 >From a7b444bd75d6f83ed0f5692783990a59f36e8459 Mon Sep 17 00:00:00 2001 From: wlei Date: Thu, 31 Oct 2024 09:58:27 -0700 Subject: [PATCH 1/4] Reapply "[InstrPGO] Support cold function coverage instrumentation

[clang] [llvm] [InstrPGO] Avoid using global variable to fix potential data race (PR #114364)

2024-10-31 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/114364 >From a7b444bd75d6f83ed0f5692783990a59f36e8459 Mon Sep 17 00:00:00 2001 From: wlei Date: Thu, 31 Oct 2024 09:58:27 -0700 Subject: [PATCH 1/4] Reapply "[InstrPGO] Support cold function coverage instrumentation

[clang] [llvm] [InstrPGO] Avoid using global variable to fix potential data race (PR #114364)

2024-10-31 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/114364 >From a7b444bd75d6f83ed0f5692783990a59f36e8459 Mon Sep 17 00:00:00 2001 From: wlei Date: Thu, 31 Oct 2024 09:58:27 -0700 Subject: [PATCH 1/3] Reapply "[InstrPGO] Support cold function coverage instrumentation

[clang] [llvm] [InstrPGO] Avoid using global variable to fix potential data race (PR #114364)

2024-10-31 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/114364 >From a7b444bd75d6f83ed0f5692783990a59f36e8459 Mon Sep 17 00:00:00 2001 From: wlei Date: Thu, 31 Oct 2024 09:58:27 -0700 Subject: [PATCH 1/3] Reapply "[InstrPGO] Support cold function coverage instrumentation

[clang] [llvm] [InstrPGO] Support cold function coverage instrumentation (PR #109837)

2024-10-31 Thread Lei Wang via cfe-commits
@@ -1182,8 +1187,13 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, const bool IsCtxProfUse = !UseCtxProfile.empty() && Phase == ThinOrFullLTOPhase::ThinLTOPreLink; + // Enable cold function coverage instrumentation if + // InstrumentColdF

[clang] [llvm] [InstrPGO] Avoid using global variable to fix potential data race (PR #114364)

2024-10-31 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm ready_for_review https://github.com/llvm/llvm-project/pull/114364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Avoid using global variable to fix potential data race (PR #114364)

2024-10-30 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm created https://github.com/llvm/llvm-project/pull/114364 In https://github.com/llvm/llvm-project/pull/109837, it sets a global variable(`PGOInstrumentColdFunctionOnly`) in PassBuilderPipelines.cpp which introduced a data race detected by TSan. To fix this, I decoup

[clang] [llvm] [InstrPGO] Support cold function coverage instrumentation (PR #109837)

2024-10-30 Thread Lei Wang via cfe-commits
@@ -1182,8 +1187,13 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, const bool IsCtxProfUse = !UseCtxProfile.empty() && Phase == ThinOrFullLTOPhase::ThinLTOPreLink; + // Enable cold function coverage instrumentation if + // InstrumentColdF

[clang] specify clang --target to fix breakage on AIX (PR #114127)

2024-10-29 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm closed https://github.com/llvm/llvm-project/pull/114127 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] specify clang --target to fix breakage on AIX (PR #114127)

2024-10-29 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/114127 >From 2c2ddcc9bda277c6da7b51147785c0f1e88b848d Mon Sep 17 00:00:00 2001 From: wlei Date: Tue, 29 Oct 2024 13:28:33 -0700 Subject: [PATCH] specify clang --target to fix breakage on AIX --- clang/test/CodeGen/

[clang] specify clang --target to fix breakage on AIX (PR #114127)

2024-10-29 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm created https://github.com/llvm/llvm-project/pull/114127 `-fprofile-sample-use` is not supported on AIX, which caused a CI failure. >From 2c2ddcc9bda277c6da7b51147785c0f1e88b848d Mon Sep 17 00:00:00 2001 From: wlei Date: Tue, 29 Oct 2024 13:28:33 -0700 Subject: [PA

[clang] [llvm] [InstrPGO] Support cold function coverage instrumentation (PR #109837)

2024-10-29 Thread Lei Wang via cfe-commits
wlei-llvm wrote: > Hi, this PR is causing a regression on the AIX bot here > https://lab.llvm.org/buildbot/#/builders/64/builds/1321/steps/6/logs/FAIL__Clang__pgo-cold-function-coverage_c. > Would you be able to take a look? I think it can be resolved by using > clang_cc1 in the testcase of ma

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-10-28 Thread Lei Wang via llvm-branch-commits
@@ -628,9 +618,75 @@ void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees( } } } -if (Cur && Decoder.getFuncDescForGUID(GUID)->FuncHash == Hash) +// Don't match nodes if the profile is stale (mismatching binary FuncHash +// and YAML Hash)

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-10-28 Thread Lei Wang via llvm-branch-commits
@@ -722,12 +722,28 @@ class BinaryContext { /// Stats for stale profile matching: /// the total number of basic blocks in the profile uint32_t NumStaleBlocks{0}; -/// the number of matched basic blocks -uint32_t NumMatchedBlocks{0}; +/// the number

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-10-28 Thread Lei Wang via llvm-branch-commits
wlei-llvm wrote: > Ping @wlei-llvm Sorry for the delay. The new version addressed my last comment (with just minor nits). However, I didn't fully follow the new features related to `ProbeMatchSpecs` stuffs. Could you add more descriptions to the diff summary? Or if it’s not a lot of work, cou

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function v2 (PR #110330)

2024-10-28 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm closed https://github.com/llvm/llvm-project/pull/110330 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Support cold function coverage instrumentation (PR #109837)

2024-10-28 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm closed https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Support cold function coverage instrumentation (PR #109837)

2024-10-28 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 07a2cab3fa5df2965f9f7da9ee2d3603581a47f1 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH 1/8] [InstrPGO] Instrument sampling profile based cold function --- c

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 07a2cab3fa5df2965f9f7da9ee2d3603581a47f1 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH 1/8] [InstrPGO] Instrument sampling profile based cold function --- c

[llvm-branch-commits] [llvm] [BOLT] Add profile density computation (PR #101094)

2024-10-24 Thread Lei Wang via llvm-branch-commits
https://github.com/wlei-llvm approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/101094 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-21 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 07a2cab3fa5df2965f9f7da9ee2d3603581a47f1 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH 1/7] [InstrPGO] Instrument sampling profile based cold function --- c

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-21 Thread Lei Wang via cfe-commits
@@ -649,6 +649,24 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C, } } + if (auto *ColdFuncCoverageArg = Args.getLastArg( + options::OPT_fprofile_generate_cold_function_coverage, + options::OPT_fprofile_generate_cold_function

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-21 Thread Lei Wang via cfe-commits
@@ -319,6 +319,29 @@ static cl::opt PGOFunctionCriticalEdgeThreshold( cl::desc("Do not instrument functions with the number of critical edges " " greater than this threshold.")); +static cl::opt ColdFuncCoverageMaxEntryCount( +"cold-function-coverage-max-e

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-21 Thread Lei Wang via cfe-commits
@@ -1784,6 +1784,12 @@ defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling", PosFlag, NegFlag>; +def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">, +Group, Visibility<[ClangOption, CLOption]>, +

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-09 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 07a2cab3fa5df2965f9f7da9ee2d3603581a47f1 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH 1/6] [InstrPGO] Instrument sampling profile based cold function --- c

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-08 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 07a2cab3fa5df2965f9f7da9ee2d3603581a47f1 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH 1/5] [InstrPGO] Instrument sampling profile based cold function --- c

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-08 Thread Lei Wang via cfe-commits
@@ -1119,6 +1125,18 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, // removed. MPM.addPass( PGOIndirectCallPromotion(true /* IsInLTO */, true /* SamplePGO */)); + +if (InstrumentSampleColdFuncPath.getNumOccurrences() && +

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-08 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 07a2cab3fa5df2965f9f7da9ee2d3603581a47f1 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH 1/4] [InstrPGO] Instrument sampling profile based cold function --- c

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-08 Thread Lei Wang via cfe-commits
@@ -1119,6 +1125,18 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, // removed. MPM.addPass( PGOIndirectCallPromotion(true /* IsInLTO */, true /* SamplePGO */)); + +if (InstrumentSampleColdFuncPath.getNumOccurrences() && +

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-02 Thread Lei Wang via cfe-commits
@@ -1119,6 +1125,18 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, // removed. MPM.addPass( PGOIndirectCallPromotion(true /* IsInLTO */, true /* SamplePGO */)); + +if (InstrumentSampleColdFuncPath.getNumOccurrences() && +

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-02 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 07a2cab3fa5df2965f9f7da9ee2d3603581a47f1 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH 1/3] [InstrPGO] Instrument sampling profile based cold function --- c

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-02 Thread Lei Wang via cfe-commits
@@ -0,0 +1,24 @@ +; RUN: opt < %s --passes=pgo-instr-gen -instrument-cold-function-coverage -S | FileCheck --check-prefixes=COLD %s +; RUN: opt < %s --passes=pgo-instr-gen -instrument-cold-function-coverage -cold-function-coverage-max-entry-count=1 -S | FileCheck --check-pr

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-02 Thread Lei Wang via cfe-commits
@@ -1119,6 +1125,18 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level, // removed. MPM.addPass( PGOIndirectCallPromotion(true /* IsInLTO */, true /* SamplePGO */)); + +if (InstrumentSampleColdFuncPath.getNumOccurrences() && +

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-02 Thread Lei Wang via cfe-commits
@@ -1784,6 +1784,12 @@ defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling", PosFlag, NegFlag>; +def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">, wlei-llvm wrote: >Would -Wl,-lclang

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-02 Thread Lei Wang via cfe-commits
@@ -1784,6 +1784,12 @@ defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling", PosFlag, NegFlag>; +def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">, wlei-llvm wrote: > I meant, why not

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-01 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-01 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 07a2cab3fa5df2965f9f7da9ee2d3603581a47f1 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH 1/2] [InstrPGO] Instrument sampling profile based cold function --- c

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-01 Thread Lei Wang via cfe-commits
wlei-llvm wrote: Thanks for the context! > Why not use the existing `-pgo-function-entry-coverage` > (https://discourse.llvm.org/t/instrprofiling-lightweight-instrumentation/59113/14?u=ellishg) > LLVM flag? It takes advantage of the `llvm.instrprof.cover` intrinsic which > has less size and r

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-01 Thread Lei Wang via cfe-commits
wlei-llvm wrote: > For your use case, can you use > [ProfileSymbolList](https://github.com/llvm/llvm-project/blob/32ffc9fdc2cd422c88c926b862adb3de726e3888/llvm/include/llvm/ProfileData/SampleProf.h#L1509-L1512) > to identify very cold functions (executed but unsampled) or are you indeed > look

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-01 Thread Lei Wang via cfe-commits
@@ -1784,6 +1784,12 @@ defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling", PosFlag, NegFlag>; +def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">, wlei-llvm wrote: Sorry if my PR des

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-10-01 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm ready_for_review https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-09-30 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 07a2cab3fa5df2965f9f7da9ee2d3603581a47f1 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH] [InstrPGO] Instrument sampling profile based cold function --- clang/

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-09-30 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-09-29 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-09-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #110330)

2024-09-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm created https://github.com/llvm/llvm-project/pull/110330 None >From d660d3b9a043a3530a735c1b95790116f6366062 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH 1/2] [InstrPGO] Instrument sampling profile based cold function

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function v2 (PR #110330)

2024-09-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/110330 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function v2 (PR #110330)

2024-09-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/110330 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-09-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 436ab3bfb3d7f1978ba1598ec7d3ca006706cbd3 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH] [InstrPGO] Instrument sampling profile based cold function --- clang/

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-09-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 36a747b5ef2123dd10909b91ad963e30af63b3b8 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH] [InstrPGO] Instrument sampling profile based cold function --- clang/

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-09-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm updated https://github.com/llvm/llvm-project/pull/109837 >From 6a9b51130269975b5832a5439897dcb34b9dc942 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH] [InstrPGO] Instrument sampling profile based cold function --- clang/

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-09-27 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm edited https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)

2024-09-24 Thread Lei Wang via cfe-commits
https://github.com/wlei-llvm created https://github.com/llvm/llvm-project/pull/109837 None >From b693ff3c33dcf21c1343d9d3432b1d7410a8b579 Mon Sep 17 00:00:00 2001 From: wlei Date: Sun, 22 Sep 2024 20:23:20 -0700 Subject: [PATCH] [InstrPGO] Instrument sampling profile based cold function ---

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext &BC) { return MatchedWithCallGraph; } +void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees( +const MCPseudoProbeDecoder &Decoder, +const yaml::bolt::PseudoProbeDesc &YamlPD, +

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext &BC) { return MatchedWithCallGraph; } +void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees( +const MCPseudoProbeDecoder &Decoder, +const yaml::bolt::PseudoProbeDesc &YamlPD, +

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase { YamlBFAdjacencyMap; }; + // A class for matching inline tree nodes between profile and binary. + class InlineTreeNodeMapTy { +DenseMap Map; + +void mapInlineTreeNode(uint32_t ProfileNo

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext &BC) { return MatchedWithCallGraph; } +void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees( +const MCPseudoProbeDecoder &Decoder, +const yaml::bolt::PseudoProbeDesc &YamlPD, +

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase { YamlBFAdjacencyMap; }; + // A class for matching inline tree nodes between profile and binary. + class InlineTreeNodeMapTy { +DenseMap Map; + +void mapInlineTreeNode(uint32_t ProfileNo

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase { YamlBFAdjacencyMap; }; + // A class for matching inline tree nodes between profile and binary. + class InlineTreeNodeMapTy { +DenseMap Map; wlei-llvm wrote: add comments

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -266,6 +305,69 @@ class StaleMatcher { } return BestBlock; } + + /// Matches a profile block with an binary block based on pseudo probes. wlei-llvm wrote: nit: `an` -> `a` https://github.com/llvm/llvm-project/pull/99891 _

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase { YamlBFAdjacencyMap; }; + // A class for matching inline tree nodes between profile and binary. + class InlineTreeNodeMapTy { +DenseMap Map; + +void mapInlineTreeNode(uint32_t ProfileNo

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase { YamlBFAdjacencyMap; }; + // A class for matching inline tree nodes between profile and binary. + class InlineTreeNodeMapTy { +DenseMap Map; + +void mapInlineTreeNode(uint32_t ProfileNo

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -0,0 +1,62 @@ +## Tests stale block matching with pseudo probes. + +# REQUIRES: system-linux +# RUN: split-file %s %t +# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %t/main.s -o %t.o +# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib +# RUN: llvm-bolt %t.exe -

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -722,12 +722,28 @@ class BinaryContext { /// Stats for stale profile matching: /// the total number of basic blocks in the profile uint32_t NumStaleBlocks{0}; -/// the number of matched basic blocks -uint32_t NumMatchedBlocks{0}; +/// the number

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext &BC) { return MatchedWithCallGraph; } +void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees( +const MCPseudoProbeDecoder &Decoder, +const yaml::bolt::PseudoProbeDesc &YamlPD, +

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -266,6 +305,69 @@ class StaleMatcher { } return BestBlock; } + + /// Matches a profile block with an binary block based on pseudo probes. + /// Returns the best matching block (or nullptr) and whether the match is + /// unambiguous. + std::pair matchWithPseudoP

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -722,6 +770,15 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) { } } + if (opts::StaleMatchingWithPseudoProbes) { +const MCPseudoProbeDecoder *Decoder = BC.getPseudoProbeDecoder(); +assert(Decoder && + "If pseudo probes are in use, pseudo

[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-09-18 Thread Lei Wang via llvm-branch-commits
@@ -587,6 +590,51 @@ size_t YAMLProfileReader::matchWithCallGraph(BinaryContext &BC) { return MatchedWithCallGraph; } +void YAMLProfileReader::InlineTreeNodeMapTy::matchInlineTrees( +const MCPseudoProbeDecoder &Decoder, +const yaml::bolt::PseudoProbeDesc &YamlPD, +

  1   2   3   4   5   6   >