[clang] [Coverage] Support -fprofile-list for cold function coverage (PR #136333)

2025-05-08 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg approved this pull request. https://github.com/llvm/llvm-project/pull/136333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [lld] [llvm] [InstrProf] Remove -forder-file-instrumentation (PR #130192)

2025-03-13 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg closed https://github.com/llvm/llvm-project/pull/130192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [lld] [llvm] [InstrProf] Remove -forder-file-instrumentation (PR #130192)

2025-03-07 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/130192 >From 72109c24229ce3a1deda9f8303e6e75677cd0ce4 Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Thu, 6 Mar 2025 14:17:51 -0800 Subject: [PATCH 1/2] [InstrProf] Remove -forder-file-instrumentation --- clang/docs

[clang] [compiler-rt] [lld] [llvm] [InstrProf] Remove -forder-file-instrumentation (PR #130192)

2025-03-06 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/130192 Completely remove `-forder-file-instrumentation`. This was deprecated in https://github.com/llvm/llvm-project/pull/121514 and removal was planned in https://discourse.llvm.org/t/deprecate-forder-file-instrument

[clang] Avoid Assertion Failure Using -fcs-profile-generate with distributed thin-lto (PR #129736)

2025-03-05 Thread Ellis Hoag via cfe-commits
@@ -1334,7 +1334,10 @@ runThinLTOBackend(CompilerInstance &CI, ModuleSummaryIndex *CombinedIndex, // Context sensitive profile. if (CGOpts.hasProfileCSIRInstr()) { Conf.RunCSIRInstr = true; -Conf.CSIRProfile = std::move(CGOpts.InstrProfileOutput); +Conf.CSIRPro

[clang] [llvm] [memprof] Export __memprof_default_options_str on Darwin (PR #128920)

2025-02-28 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/128920 >From 2e1946730f7ae2473a4fc94f8918eb3d9d225d17 Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Wed, 26 Feb 2025 09:48:46 -0800 Subject: [PATCH 1/3] [memprof] Export __memprof_default_options_str on Darwin ---

[clang] [llvm] [memprof] Export __memprof_default_options_str on Darwin (PR #128920)

2025-02-28 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/128920 >From 2e1946730f7ae2473a4fc94f8918eb3d9d225d17 Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Wed, 26 Feb 2025 09:48:46 -0800 Subject: [PATCH 1/2] [memprof] Export __memprof_default_options_str on Darwin ---

[clang] [memprof] Export __memprof_default_options_str on Darwin (PR #128920)

2025-02-27 Thread Ellis Hoag via cfe-commits
@@ -1617,6 +1617,10 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, } } + if (Sanitize.needsMemProfRt()) +if (hasExportSymbolDirective(Args)) + addExportedSymbol(CmdArgs, "___memprof_default_options_str"); ellishg wrote: @tere

[clang] [llvm] [memprof] Add memprof options as a clang frontend flag (PR #128615)

2025-02-27 Thread Ellis Hoag via cfe-commits
ellishg wrote: Moved to https://github.com/llvm/llvm-project/pull/128920 https://github.com/llvm/llvm-project/pull/128615 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [memprof] Add memprof options as a clang frontend flag (PR #128615)

2025-02-27 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg closed https://github.com/llvm/llvm-project/pull/128615 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [memprof] Export __memprof_default_options_str on Darwin (PR #128920)

2025-02-26 Thread Ellis Hoag via cfe-commits
@@ -1617,6 +1617,10 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, } } + if (Sanitize.needsMemProfRt()) +if (hasExportSymbolDirective(Args)) + addExportedSymbol(CmdArgs, "___memprof_default_options_str"); ellishg wrote: Yes,

[clang] [memprof] Export __memprof_default_options_str on Darwin (PR #128920)

2025-02-26 Thread Ellis Hoag via cfe-commits
@@ -17,3 +17,11 @@ // RUN: not %clangxx --target=x86_64-linux-gnu -fprofile-generate -fmemory-profile-use=foo %s -### 2>&1 | FileCheck %s --check-prefix=CONFLICTWITHPGOINSTR // CONFLICTWITHPGOINSTR: error: invalid argument '-fmemory-profile-use=foo' not allowed with '-fprof

[clang] [memprof] Export __memprof_default_options_str on Darwin (PR #128920)

2025-02-26 Thread Ellis Hoag via cfe-commits
@@ -1617,6 +1617,10 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, } } + if (Sanitize.needsMemProfRt()) +if (hasExportSymbolDirective(Args)) + addExportedSymbol(CmdArgs, "___memprof_default_options_str"); ellishg wrote: @tere

[clang] [memprof] Export __memprof_default_options_str on Darwin (PR #128920)

2025-02-26 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/128920 The `-memprof-runtime-default-options` LLVM flag introduced in https://github.com/llvm/llvm-project/pull/118874 creates the `__memprof_default_options_str` symbol with `WeakAnyLinkage` on Darwin. https://githu

[clang] [llvm] [memprof] Add memprof options as a clang frontend flag (PR #128615)

2025-02-26 Thread Ellis Hoag via cfe-commits
ellishg wrote: > Not opposed to adding this as a clang driver flag especially if it is needed > for something other than testing/debugging, however, you could presumably > always add the exported symbol when -fmemory-profiler is specified (or does > the linker give an error if the specified sy

[clang] [llvm] [memprof] Add memprof options as a clang frontend flag (PR #128615)

2025-02-25 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/128615 >From fa0202169af23419c4bcbf66eabd1beb6b6e8e34 Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Mon, 24 Feb 2025 17:57:48 -0800 Subject: [PATCH 1/2] [memprof] Add memprof options clang frontend flag --- clang/i

[clang] [llvm] [memprof] Add memprof options as a clang frontend flag (PR #128615)

2025-02-24 Thread Ellis Hoag via cfe-commits
ellishg wrote: CC @SharonXSharon https://github.com/llvm/llvm-project/pull/128615 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [memprof] Add memprof options as a clang frontend flag (PR #128615)

2025-02-24 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/128615 Add the clang frontend flag `-fmemory-profile-runtime-default-options` to support the `-memprof-runtime-default-options` LLVM flag introduced in https://github.com/llvm/llvm-project/pull/118874. This enables u

[clang] [InstrProf] Fix format issue in user manual (PR #122559)

2025-01-10 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg closed https://github.com/llvm/llvm-project/pull/122559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [InstrProf] Fix format issue in user manual (PR #122559)

2025-01-10 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/122559 Fix a small formatting issue in the user manual. https://clang.llvm.org/docs/UsersManual.html#cmdoption-ftemporal-profile >From 051de1349338cee46e33f63af99f58d0552afb44 Mon Sep 17 00:00:00 2001 From: Ellis Hoag

[clang] [InstrProf] Fix format issue in user manual (PR #122559)

2025-01-10 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg edited https://github.com/llvm/llvm-project/pull/122559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [InstrProf] Add frontend temporal profiling flag (PR #122385)

2025-01-10 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg closed https://github.com/llvm/llvm-project/pull/122385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [InstrProf] Add frontend temporal profiling flag (PR #122385)

2025-01-10 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg edited https://github.com/llvm/llvm-project/pull/122385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [InstrProf] Add frontend temporal profiling flag (PR #122385)

2025-01-10 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/122385 >From 28e1eb2d0383bf417f8f769f6964eacb02a45477 Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Thu, 9 Jan 2025 14:51:13 -0800 Subject: [PATCH 1/3] [InstrProf] Add frontent temporal profiling flag --- clang/inc

[clang] [InstrProf] Add frontend temporal profiling flag (PR #122385)

2025-01-09 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/122385 >From 28e1eb2d0383bf417f8f769f6964eacb02a45477 Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Thu, 9 Jan 2025 14:51:13 -0800 Subject: [PATCH 1/2] [InstrProf] Add frontent temporal profiling flag --- clang/inc

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-09 Thread Ellis Hoag via cfe-commits
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } - if (Args.hasArg(options::OPT_forder_file_instrumentation)) { - CmdArgs.push_back("-forder-file-instrumentation"); - // Enable order file instrumentation when ThinLTO is

[clang] [InstrProf] Add frontend temporal profiling flag (PR #122385)

2025-01-09 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/122385 As discussed in https://github.com/llvm/llvm-project/pull/121514 add the frontent flag `-fprofile-generate-temporal-instrumentation` to enable temporal profiling (https://discourse.llvm.org/t/rfc-temporal-prof

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-08 Thread Ellis Hoag via cfe-commits
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } - if (Args.hasArg(options::OPT_forder_file_instrumentation)) { - CmdArgs.push_back("-forder-file-instrumentation"); - // Enable order file instrumentation when ThinLTO is

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-07 Thread Ellis Hoag via cfe-commits
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } - if (Args.hasArg(options::OPT_forder_file_instrumentation)) { - CmdArgs.push_back("-forder-file-instrumentation"); - // Enable order file instrumentation when ThinLTO is

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-06 Thread Ellis Hoag via cfe-commits
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } - if (Args.hasArg(options::OPT_forder_file_instrumentation)) { - CmdArgs.push_back("-forder-file-instrumentation"); - // Enable order file instrumentation when ThinLTO is

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-03 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg closed https://github.com/llvm/llvm-project/pull/121514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-03 Thread Ellis Hoag via cfe-commits
ellishg wrote: > Is the plan to reuse the clang option -forder-file-instrumentation in the > future? No I wasn't planning on it. I'd like to remove this code for maintainability reasons and to encourage others to use IRPGO instead https://github.com/llvm/llvm-project/pull/121514

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-02 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/121514 >From 432c55783cbb5d4a9675f1f6018b58ffc4fe636d Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Thu, 2 Jan 2025 10:51:54 -0800 Subject: [PATCH 1/2] Deprecate order file instrumentation --- clang/include/clang/D

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-02 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg edited https://github.com/llvm/llvm-project/pull/121514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-02 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/121514 `-forder-file-instrumentation` is used to instrument a startup function order, but this feature is also in IRPGO as Temporal Profiling. As discussed in https://discourse.llvm.org/t/rfc-temporal-profiling-extens

[clang] [CGObjC] Use llvm::isKnownNonZero to determine if receiver can be null. (PR #114914)

2024-11-04 Thread Ellis Hoag via cfe-commits
ellishg wrote: Yeah it seems good to me, but we should have a test case too https://github.com/llvm/llvm-project/pull/114914 ___ 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-09 Thread Ellis Hoag via cfe-commits
@@ -1891,6 +1914,12 @@ static bool skipPGOGen(const Function &F) { return true; if (F.getInstructionCount() < PGOFunctionSizeThreshold) return true; + if (InstrumentColdFunctionCoverage) { +if (!F.getEntryCount()) + return InstrumentColdFunctionCoverageMode

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

2024-10-09 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg 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-09 Thread Ellis Hoag 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-09 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg approved this pull request. The backend looks good to me! (after resolving my last comments of course) Thanks for adding this feature! https://github.com/llvm/llvm-project/pull/109837 ___ cfe-commits mailing list cfe-commits@

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

2024-10-08 Thread Ellis Hoag 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 Ellis Hoag 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 Ellis Hoag 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-01 Thread Ellis Hoag 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-01 Thread Ellis Hoag 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-01 Thread Ellis Hoag 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-01 Thread Ellis Hoag via cfe-commits
@@ -0,0 +1,12 @@ +// Test -fprofile-generate-cold-function-coverage +// RUN: %clang -O2 -fprofile-generate-cold-function-coverage=/xxx/yyy/ -fprofile-sample-accurate -fprofile-sample-use=%S/Inputs/pgo-cold-func.prof -S -emit-llvm -o - %s | FileCheck %s ellishg

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

2024-10-01 Thread Ellis Hoag via cfe-commits
ellishg wrote: > > 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 runtime overhead tha

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

2024-10-01 Thread Ellis Hoag via cfe-commits
ellishg wrote: 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 runtime overhead than `llvm.instrpro

[clang] [Clang] Implement labelled type filtering for overflow/truncation sanitizers w/ SSCLs (PR #107332)

2024-09-25 Thread Ellis Hoag via cfe-commits
@@ -48,6 +49,63 @@ Example $ clang -fsanitize=address -fsanitize-ignorelist=ignorelist.txt foo.c ; ./a.out # No error report here. +Usage with UndefinedBehaviorSanitizer += + +The arithmetic overflow sanitizers ``unsigned-integer-overfl

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-09-17 Thread Ellis Hoag via cfe-commits
ellishg wrote: Oh I just saw that you have dependent changes in https://github.com/llvm/llvm-project/pull/90934. I think when you create your PR, you can specify a base branch. If you select the branch for https://github.com/llvm/llvm-project/pull/90934, I believe it won't show those changes

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-09-17 Thread Ellis Hoag via cfe-commits
@@ -164,6 +164,22 @@ publishOutlinedHashTree(std::unique_ptr HashTree) { CodeGenData::getInstance().publishOutlinedHashTree(std::move(HashTree)); } +/// Initialize the two-codegen rounds. +void initializeTwoCodegenRounds(); + +/// Save the current module before the first co

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-09-17 Thread Ellis Hoag via cfe-commits
@@ -215,6 +224,76 @@ void warn(Error E, StringRef Whence) { } } +static std::string getPath(StringRef Dir, unsigned Task) { + return (Dir + "/" + llvm::Twine(Task) + ".saved_copy.bc").str(); ellishg wrote: Will this work on windows? Can we use `llvm::sys::

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-09-17 Thread Ellis Hoag via cfe-commits
@@ -164,6 +164,22 @@ publishOutlinedHashTree(std::unique_ptr HashTree) { CodeGenData::getInstance().publishOutlinedHashTree(std::move(HashTree)); } +/// Initialize the two-codegen rounds. ellishg wrote: This comment isn't very useful (thanks to the functio

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-09-17 Thread Ellis Hoag via cfe-commits
@@ -164,6 +164,22 @@ publishOutlinedHashTree(std::unique_ptr HashTree) { CodeGenData::getInstance().publishOutlinedHashTree(std::move(HashTree)); } +/// Initialize the two-codegen rounds. +void initializeTwoCodegenRounds(); + +/// Save the current module before the first co

[clang] [CGData] Clang Options (PR #90304)

2024-09-12 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg commented: Can we add some documentation to https://github.com/llvm/llvm-project/blob/main/clang/docs/UsersManual.rst? This could also be a separate PR. LGTM, but I want to give others a chance to review. https://github.com/llvm/llvm-project/pull/90304 _

[clang] [CGData] Clang Options (PR #90304)

2024-09-11 Thread Ellis Hoag via cfe-commits
@@ -1894,6 +1894,18 @@ def fprofile_selected_function_group : Visibility<[ClangOption, CC1Option]>, MetaVarName<"">, HelpText<"Partition functions into N groups using -fprofile-function-groups and select only functions in group i to be instrumented. The valid range is 0 to

[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-07 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg closed https://github.com/llvm/llvm-project/pull/90925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-07 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg edited https://github.com/llvm/llvm-project/pull/90925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-07 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/90925 >From 4760ebce0ff7725f4bb75f5107f551d867e4db6d Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Thu, 2 May 2024 17:47:38 -0700 Subject: [PATCH 1/4] [modules] Accept equivalent module caches from different symlink

[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-07 Thread Ellis Hoag via cfe-commits
ellishg wrote: @benlangmuir do you have other concerns? Can I get a stamp? https://github.com/llvm/llvm-project/pull/90925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-03 Thread Ellis Hoag via cfe-commits
@@ -839,17 +839,15 @@ static bool checkHeaderSearchOptions(const HeaderSearchOptions &HSOpts, DiagnosticsEngine *Diags, const LangOptions &LangOpts, const Preprocesso

[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-03 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/90925 >From 4760ebce0ff7725f4bb75f5107f551d867e4db6d Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Thu, 2 May 2024 17:47:38 -0700 Subject: [PATCH 1/3] [modules] Accept equivalent module caches from different symlink

[clang] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-03 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg updated https://github.com/llvm/llvm-project/pull/90925 >From 4760ebce0ff7725f4bb75f5107f551d867e4db6d Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Thu, 2 May 2024 17:47:38 -0700 Subject: [PATCH 1/2] [modules] Accept equivalent module caches from different symlink

[clang] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-02 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/90925 Use `fs::equivalent()`, which follows symlinks, to check if two module cache paths are equivalent. This prevents a PCH error when building from a different path that is a symlink of the original. ``` error: PCH

[clang] [clang-tools-extra] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] Fix SyntaxWarning messages from python 3.12 (PR #86806)

2024-03-27 Thread Ellis Hoag via cfe-commits
@@ -101,7 +101,7 @@ def extract_result_types(comment): def strip_doxygen(comment): -"""Returns the given comment without \-escaped words.""" +"""Returns the given comment without \\-escaped words.""" ellishg wrote: I see lots of changes to comment bl

[clang] [llvm] [SpecialCaseList] Use glob by default (PR #74809)

2024-03-14 Thread Ellis Hoag via cfe-commits
ellishg wrote: > A report from the field: we had an ignorelist that contained > `[cfi-vcall|cfi-nvcall|cfi-icall]`. This was recommended syntax from the > documentation > (https://releases.llvm.org/17.0.1/tools/clang/docs/SanitizerSpecialCaseList.html)... > but it broke with the transition.

[clang] [compiler-rt] [llvm] [InstrProf] Single byte counters in coverage (PR #75425)

2024-02-15 Thread Ellis Hoag via cfe-commits
ellishg wrote: LGTM, but I'm less familiar with the clang coverage code. So I'll give others some time to accept. https://github.com/llvm/llvm-project/pull/75425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [compiler-rt] [llvm] [InstrProf] Single byte counters in coverage (PR #75425)

2024-02-14 Thread Ellis Hoag via cfe-commits
@@ -821,15 +822,23 @@ void InstrProfRecord::merge(InstrProfRecord &Other, uint64_t Weight, for (size_t I = 0, E = Other.Counts.size(); I < E; ++I) { bool Overflowed; -uint64_t Value = -SaturatingMultiplyAdd(Other.Counts[I], Weight, Counts[I], &Overflowed); -

[clang] [compiler-rt] [llvm] [InstrProf] Single byte counters in coverage (PR #75425)

2024-02-14 Thread Ellis Hoag via cfe-commits
@@ -821,15 +822,23 @@ void InstrProfRecord::merge(InstrProfRecord &Other, uint64_t Weight, for (size_t I = 0, E = Other.Counts.size(); I < E; ++I) { bool Overflowed; -uint64_t Value = -SaturatingMultiplyAdd(Other.Counts[I], Weight, Counts[I], &Overflowed); -

[llvm] [clang] [clang-tools-extra] [compiler-rt] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-18 Thread Ellis Hoag via cfe-commits
@@ -118,18 +118,18 @@ cl::opt ProfiledBinary( "profiled-binary", cl::init(""), cl::desc("Path to binary from which the profile was collected."), cl::sub(ShowSubcommand), cl::sub(MergeSubcommand)); -cl::opt DebugInfoFilename( -"debug-info", cl::init(""), +cl::lis

[compiler-rt] [clang] [clang-tools-extra] [llvm] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2024-01-17 Thread Ellis Hoag via cfe-commits
@@ -118,18 +118,18 @@ cl::opt ProfiledBinary( "profiled-binary", cl::init(""), cl::desc("Path to binary from which the profile was collected."), cl::sub(ShowSubcommand), cl::sub(MergeSubcommand)); -cl::opt DebugInfoFilename( -"debug-info", cl::init(""), +cl::lis

[clang] [llvm] [SpecialCaseList] Use glob by default (PR #74809)

2024-01-05 Thread Ellis Hoag via cfe-commits
ellishg wrote: > This caused some ignorelist changes, e.g. > > > > `src:*third_party/vulkan_memory_allocator/include/vk_mem_alloc.h` > > > > didn't work anymore and the opt-out made it work again. Still investigating > why. Not sure if it's the reason, but the `.` in `vk_mem_alloc.h` matc

[clang-tools-extra] [clang] [llvm] [compiler-rt] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Ellis Hoag via cfe-commits
@@ -118,18 +118,18 @@ cl::opt ProfiledBinary( "profiled-binary", cl::init(""), cl::desc("Path to binary from which the profile was collected."), cl::sub(ShowSubcommand), cl::sub(MergeSubcommand)); -cl::opt DebugInfoFilename( -"debug-info", cl::init(""), +cl::lis

[clang-tools-extra] [clang] [llvm] [compiler-rt] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Ellis Hoag via cfe-commits
@@ -118,18 +118,18 @@ cl::opt ProfiledBinary( "profiled-binary", cl::init(""), cl::desc("Path to binary from which the profile was collected."), cl::sub(ShowSubcommand), cl::sub(MergeSubcommand)); -cl::opt DebugInfoFilename( -"debug-info", cl::init(""), +cl::lis

[clang-tools-extra] [compiler-rt] [clang] [llvm] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Ellis Hoag via cfe-commits
@@ -481,3 +509,49 @@ Error BinaryInstrProfCorrelator::correlateProfileNameImpl() { this->Names.append(this->Ctx->NameStart, this->Ctx->NameSize); return Error::success(); } + +llvm::Expected> InstrProfCorrelators::get( +ArrayRef> +CorrelateInputs, +uint32_

[clang] [clang-tools-extra] [compiler-rt] [llvm] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Ellis Hoag via cfe-commits
@@ -0,0 +1,33 @@ +// REQUIRES: lld-available ellishg wrote: Can we also add a test to `Darwin/instrprof-correlation-mixed.test`? https://github.com/llvm/llvm-project/pull/75957 ___ cfe-commits mailing list cfe-commits@

[compiler-rt] [llvm] [clang-tools-extra] [clang] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Ellis Hoag via cfe-commits
@@ -481,3 +509,49 @@ Error BinaryInstrProfCorrelator::correlateProfileNameImpl() { this->Names.append(this->Ctx->NameStart, this->Ctx->NameSize); return Error::success(); } + +llvm::Expected> InstrProfCorrelators::get( +ArrayRef> +CorrelateInputs, +uint32_

[clang] [compiler-rt] [llvm] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Ellis Hoag via cfe-commits
@@ -0,0 +1,33 @@ +// REQUIRES: lld-available +// Test llvm-profdata merging with multiple correlation files mixing different correlation modes. + +// RUN: %clang_pgogen -o %t.normal -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instr

[llvm] [clang-tools-extra] [clang] [compiler-rt] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Ellis Hoag via cfe-commits
@@ -118,18 +118,18 @@ cl::opt ProfiledBinary( "profiled-binary", cl::init(""), cl::desc("Path to binary from which the profile was collected."), cl::sub(ShowSubcommand), cl::sub(MergeSubcommand)); -cl::opt DebugInfoFilename( -"debug-info", cl::init(""), +cl::lis

[clang] [clang-tools-extra] [compiler-rt] [llvm] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Ellis Hoag via cfe-commits
@@ -0,0 +1,33 @@ +// REQUIRES: lld-available +// Test llvm-profdata merging with multiple correlation files mixing different correlation modes. + +// RUN: %clang_pgogen -o %t.normal -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instr

[compiler-rt] [clang] [clang-tools-extra] [llvm] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Ellis Hoag via cfe-commits
@@ -0,0 +1,33 @@ +// REQUIRES: lld-available ellishg wrote: Why is lld required? https://github.com/llvm/llvm-project/pull/75957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang-tools-extra] [compiler-rt] [llvm] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

2023-12-20 Thread Ellis Hoag via cfe-commits
@@ -25,6 +25,25 @@ // RUN: diff <(llvm-profdata show --all-functions --counts %t.cov.normal.profdata) <(llvm-profdata show --all-functions --counts %t.cov.profdata) +// Test debug info correlate with build id. ellishg wrote: Can you add a test to `Darwin/i

[compiler-rt] [llvm] [clang] [InstrProf] Single byte counters in coverage (PR #75425)

2023-12-14 Thread Ellis Hoag via cfe-commits
@@ -821,15 +822,23 @@ void InstrProfRecord::merge(InstrProfRecord &Other, uint64_t Weight, for (size_t I = 0, E = Other.Counts.size(); I < E; ++I) { bool Overflowed; -uint64_t Value = -SaturatingMultiplyAdd(Other.Counts[I], Weight, Counts[I], &Overflowed); -

[llvm] [compiler-rt] [clang-tools-extra] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-08 Thread Ellis Hoag via cfe-commits
@@ -1,39 +1,45 @@ -; Do setup work for all below tests: generate bitcode and combined index -; RUN: opt -module-summary %s -o %t.bc -; RUN: opt -module-summary %p/Inputs/thinlto_indirect_call_promotion.ll -o %t2.bc +; The raw profiles and reduced IR inputs are generated from Inp

[llvm] [clang] [SpecialCaseList] Use glob by default (PR #74809)

2023-12-08 Thread Ellis Hoag via cfe-commits
ellishg wrote: > Probably would be good to introduce the `-v1` version and require it first, > then eventually change the default - so people don't get a silent behavior > change? Even the existing users only using `*` and `.` need to change their > syntax to migrate to v2, right? They'll need

[clang] [llvm] [SpecialCaseList] Use glob by default (PR #74809)

2023-12-08 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg approved this pull request. Looks good to me. Thanks for following up! https://github.com/llvm/llvm-project/pull/74809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang-tools-extra] [compiler-rt] [llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-08 Thread Ellis Hoag via cfe-commits
@@ -1,39 +1,45 @@ -; Do setup work for all below tests: generate bitcode and combined index -; RUN: opt -module-summary %s -o %t.bc -; RUN: opt -module-summary %p/Inputs/thinlto_indirect_call_promotion.ll -o %t2.bc +; The raw profiles and reduced IR inputs are generated from Inp

[clang-tools-extra] [compiler-rt] [llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-07 Thread Ellis Hoag via cfe-commits
@@ -1,39 +1,45 @@ -; Do setup work for all below tests: generate bitcode and combined index -; RUN: opt -module-summary %s -o %t.bc -; RUN: opt -module-summary %p/Inputs/thinlto_indirect_call_promotion.ll -o %t2.bc +; The raw profiles and reduced IR inputs are generated from Inp

[llvm] [clang-tools-extra] [compiler-rt] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-07 Thread Ellis Hoag via cfe-commits
ellishg wrote: Please remember to remove the binaries that are not used. https://github.com/llvm/llvm-project/pull/74008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang-tools-extra] [compiler-rt] [llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-07 Thread Ellis Hoag via cfe-commits
@@ -1,39 +1,45 @@ -; Do setup work for all below tests: generate bitcode and combined index -; RUN: opt -module-summary %s -o %t.bc -; RUN: opt -module-summary %p/Inputs/thinlto_indirect_call_promotion.ll -o %t2.bc +; The raw profiles and reduced IR inputs are generated from Inp

[llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-05 Thread Ellis Hoag via cfe-commits
@@ -300,12 +316,8 @@ getIRPGONameForGlobalObject(const GlobalObject &GO, GlobalValue::LinkageTypes Linkage, StringRef FileName) { SmallString<64> Name; - if (llvm::GlobalValue::isLocalLinkage(Linkage)) { -Name.appen

[clang] [llvm] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-01 Thread Ellis Hoag via cfe-commits
@@ -300,12 +316,8 @@ getIRPGONameForGlobalObject(const GlobalObject &GO, GlobalValue::LinkageTypes Linkage, StringRef FileName) { SmallString<64> Name; - if (llvm::GlobalValue::isLocalLinkage(Linkage)) { -Name.appen

[llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-01 Thread Ellis Hoag via cfe-commits
@@ -300,12 +316,8 @@ getIRPGONameForGlobalObject(const GlobalObject &GO, GlobalValue::LinkageTypes Linkage, StringRef FileName) { SmallString<64> Name; - if (llvm::GlobalValue::isLocalLinkage(Linkage)) { -Name.appen

[clang] [llvm] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-01 Thread Ellis Hoag via cfe-commits
@@ -300,12 +316,8 @@ getIRPGONameForGlobalObject(const GlobalObject &GO, GlobalValue::LinkageTypes Linkage, StringRef FileName) { SmallString<64> Name; - if (llvm::GlobalValue::isLocalLinkage(Linkage)) { -Name.appen

[clang] [llvm] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-01 Thread Ellis Hoag via cfe-commits
@@ -300,12 +316,8 @@ getIRPGONameForGlobalObject(const GlobalObject &GO, GlobalValue::LinkageTypes Linkage, StringRef FileName) { SmallString<64> Name; - if (llvm::GlobalValue::isLocalLinkage(Linkage)) { -Name.appen

[llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-01 Thread Ellis Hoag via cfe-commits
@@ -246,11 +246,27 @@ std::string InstrProfError::message() const { char InstrProfError::ID = 0; -std::string getPGOFuncName(StringRef RawFuncName, - GlobalValue::LinkageTypes Linkage, +std::string getPGOFuncName(StringRef Name, GlobalValue::LinkageT

[llvm] [clang] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

2023-12-01 Thread Ellis Hoag via cfe-commits
@@ -300,12 +316,8 @@ getIRPGONameForGlobalObject(const GlobalObject &GO, GlobalValue::LinkageTypes Linkage, StringRef FileName) { SmallString<64> Name; - if (llvm::GlobalValue::isLocalLinkage(Linkage)) { -Name.appen

[clang] [NFC] Fix CSPGO clang pass manager test (PR #72681)

2023-11-17 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg closed https://github.com/llvm/llvm-project/pull/72681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Fix CSPGO clang pass manager test (PR #72681)

2023-11-17 Thread Ellis Hoag via cfe-commits
https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/72681 Fix a `CHECK-NOT` line in a cspgo clang test >From f548c66f5084e9ce57565b6acc6f6caae0f89a8a Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Fri, 17 Nov 2023 09:40:34 -0800 Subject: [PATCH] [NFC] Fix CSPGO clang

  1   2   >