Re: [PATCH] D18289: Attach profile summary information to module

2016-03-22 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:398 @@ -397,2 +397,3 @@ if (PGOReader) { getModule().setMaximumFunctionCount(PGOReader->getMaximumFunctionCount()); +auto *SummaryMD = PGOReader->getSummary().getMD(getModule().getContext());

Re: [PATCH] D18289: Attach profile summary information to module

2016-03-24 Thread David Li via cfe-commits
davidxl accepted this revision. davidxl added a reviewer: davidxl. davidxl added a comment. lgtm http://reviews.llvm.org/D18289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18489: [PGO, clang] Comment how function pointers for indirect calls are mapped to function names

2016-03-26 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/CodeGen/CodeGenPGO.cpp:758 @@ -757,1 +757,3 @@ + // During instrumentation, function pointers are collected for the different + // indirect call targets. Then as part of the conversion from raw to merged CodeGenP

Re: [PATCH] D18489: [PGO, clang] Comment how function pointers for indirect calls are mapped to function names

2016-03-28 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/CodeGen/CodeGenPGO.cpp:758 @@ -757,1 +757,3 @@ + // During instrumentation, function pointers are collected for the different + // indirect call targets. Then as part of the conversion from raw to merged anemet w

Re: [PATCH] D15726: Remove setting of inlinehint and cold attributes based on profile data

2015-12-30 Thread David Li via cfe-commits
davidxl accepted this revision. davidxl added a comment. This revision is now accepted and ready to land. lgtm http://reviews.llvm.org/D15726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

Re: [PATCH] D15829: [PGO] Clang Option that enables IR level PGO instrumentation

2015-12-30 Thread David Li via cfe-commits
davidxl added a comment. Should add a test case in test/Driver/instrprof-ld.c. Comment at: lib/CodeGen/BackendUtil.cpp:435 @@ +434,3 @@ + if (CodeGenOpts.ProfileIRInstr) { +assert (!CodeGenOpts.ProfileInstrGenerate); +if (!CodeGenOpts.InstrProfileOutput.empty()) ---

[PATCH] D15853: [PGO]: Simplify coverage data lowering code

2016-01-03 Thread David Li via cfe-commits
davidxl created this revision. davidxl added a reviewer: vsk. davidxl added a subscriber: cfe-commits. The names referenced by the coverage data may be associated with functions that are never emitted by Clang. That means those PGO names won't be materialized into the __llvm_prf_names section du

Re: [PATCH] D15853: [PGO]: Simplify coverage data lowering code

2016-01-06 Thread David Li via cfe-commits
davidxl updated this revision to Diff 44127. davidxl added a comment. Update patch to reduce overhead: Only record names for unused functions. http://reviews.llvm.org/D15853 Files: lib/CodeGen/CodeGenPGO.cpp lib/CodeGen/CoverageMappingGen.cpp lib/CodeGen/CoverageMappingGen.h Index: lib/C

Re: [PATCH] D15853: [PGO]: Simplify coverage data lowering code

2016-01-18 Thread David Li via cfe-commits
davidxl added a comment. I missed the review comments earlier. The local var name is fixed. The getCoverageNamesVarName API name will be fixed later. Regarding to your question: the patch does not not change the behavior of the name handling. For all used functions, their names are handled in

Re: [PATCH] D8940: Clang changes for indirect call target profiling

2016-01-20 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/CodeGen/CodeGenPGO.cpp:768 @@ +767,3 @@ + llvm::IndexedInstrProfReader *PGOReader = CGM.getPGOReader(); + if (!InstrumentValueSites && !PGOReader) +return; && --> || Comment at: lib/CodeGen/Cod

Re: [PATCH] D16395: [Coverage] Reduce complexity of adding function mapping records

2016-01-21 Thread David Li via cfe-commits
davidxl accepted this revision. davidxl added a comment. This revision is now accepted and ready to land. LGTM http://reviews.llvm.org/D16395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

Re: [PATCH] D8940: Clang changes for indirect call target profiling

2016-01-22 Thread David Li via cfe-commits
davidxl accepted this revision. davidxl added a comment. This revision is now accepted and ready to land. LGTM. I think we also need a user level option to turn value profiling on/off (in followups). http://reviews.llvm.org/D8940 ___ cfe-commits m

Re: [PATCH] D15829: [PGO] Clang Option that enables IR level PGO instrumentation

2016-01-22 Thread David Li via cfe-commits
davidxl added a comment. This option is not needed for -fprofile-instr-use compilation as the compiler can detect the flavor of the profile (patch pending review), and decide what to do. The question here is what the option should look like to tell the compiler which phase to do the instrumen

Re: [PATCH] D15829: [PGO] Clang Option that enables IR level PGO instrumentation

2016-01-22 Thread David Li via cfe-commits
davidxl added a comment. For the longer term, one possible solution is to make FE based instrumentation only used for coverage testing which can be turned on with -fcoverage-mapping option (currently, -fcoverage-mapping can not be used alone and must be used together with -fprofile-instr-generate)

Re: [PATCH] D15829: [PGO] Clang Option that enables IR level PGO instrumentation

2016-01-25 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/CodeGen/BackendUtil.cpp:440 @@ +439,3 @@ + if (CodeGenOpts.ProfileIRInstr) { +// Should not have ProfileInstrGenerate set -- it is for clang +// instrumentation only. xur wrote: > silvas wrote: > > Then chang

Re: [PATCH] D15829: [PGO] Clang Option that enables IR level PGO instrumentation

2016-01-27 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/Driver/Tools.cpp:5520 @@ +5519,3 @@ +A->claim(); +if ((StringRef(A->getValue(0)) == "-fprofile-ir-instr") && +(Args.hasArg(options::OPT_fprofile_instr_generate) || silvas wrote: > This is definitely no

Re: [PATCH] D15829: [PGO] Clang Option that enables IR level PGO instrumentation

2016-01-27 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: include/clang/Frontend/CodeGenOptions.def:106 @@ -105,3 +105,3 @@ -CODEGENOPT(ProfileInstrGenerate , 1, 0) ///< Instrument code to generate -///< execution counts to use with PGO. +CODEGENOPT(Prof

Re: [PATCH] D15829: [PGO] Clang Option that enables IR level PGO instrumentation

2016-01-28 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/Driver/Tools.cpp:3232 @@ -3231,2 +3231,3 @@ CmdArgs.push_back( Args.MakeArgString(Twine("-fprofile-instr-generate=") + Path)); +} I also suggest changing CC1 option -fprofile-instr-generate= to b

Re: [PATCH] D14215: Disable frame pointer elimination when using -pg

2015-11-19 Thread David Li via cfe-commits
davidxl added a comment. Can you also add a test case with option -momit-leaf-frame-pointer? http://reviews.llvm.org/D14215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D14215: Disable frame pointer elimination when using -pg

2015-11-20 Thread David Li via cfe-commits
davidxl accepted this revision. davidxl added a comment. This revision is now accepted and ready to land. Looks good to me. http://reviews.llvm.org/D14215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/

Re: [PATCH] D8940: Clang changes for indirect call target profiling

2015-11-29 Thread David Li via cfe-commits
davidxl added a comment. Betul, is this patch up to date? http://reviews.llvm.org/D8940 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15163: Attach maximum function count to Module when using PGO mode.

2015-12-02 Thread David Li via cfe-commits
davidxl added a comment. Should also add a test case as a followup. Example: ./projects/compiler-rt/test/profile/instrprof-basic.c David Repository: rL LLVM http://reviews.llvm.org/D15163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D15163: Attach maximum function count to Module when using PGO mode.

2015-12-10 Thread David Li via cfe-commits
davidxl added a comment. LGTM. Wait a little longer in case other reviews want to chime in. Repository: rL LLVM http://reviews.llvm.org/D15163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/

Re: [PATCH] D15163: Attach maximum function count to Module when using PGO mode.

2015-12-14 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: cfe/trunk/test/CodeGen/pgo-max-function-count.c:1 @@ +1,2 @@ +// RUN: %clang -fprofile-generate -o %t -O2 %s +// RUN: env LLVM_PROFILE_FILE=%t.profraw %t Use -fprofile-instr-generate option. -fprofile-generate is for GCC

Re: [PATCH] D15163: Attach maximum function count to Module when using PGO mode.

2015-12-15 Thread David Li via cfe-commits
davidxl added a comment. I prefer using the profile from the original test case where Max count is not 1. Repository: rL LLVM http://reviews.llvm.org/D15163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mai

Re: [PATCH] D15163: Attach maximum function count to Module when using PGO mode.

2015-12-17 Thread David Li via cfe-commits
davidxl added a comment. LGTM Repository: rL LLVM http://reviews.llvm.org/D15163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15726: Remove setting of inlinehint and cold attributes based on profile data

2015-12-22 Thread David Li via cfe-commits
davidxl added a comment. This looks like a straightforward cleanup (the test cases have been in a previous patch). http://reviews.llvm.org/D15726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [llvm] [NFCI]Remove EntryCount from FunctionSummary and clean up surrounding synthetic count passes. (PR #107471)

2024-09-05 Thread David Li via cfe-commits
https://github.com/david-xl approved this pull request. Thanks for the cleanup. https://github.com/llvm/llvm-project/pull/107471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-06 Thread David Li via cfe-commits
@@ -103,30 +110,222 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-06 Thread David Li via cfe-commits
@@ -103,30 +110,220 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-06 Thread David Li via cfe-commits
@@ -103,30 +110,220 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-06 Thread David Li via cfe-commits
@@ -103,30 +110,222 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -321,14 +746,127 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -321,14 +790,114 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -321,14 +790,114 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -103,27 +114,226 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// Indirect call promotion pass will fall back to function-based comparison if +// vtable-count / function-

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -276,35 +626,154 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( -CallBase &CB, const std::vector &Candidates, -

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -276,35 +626,154 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( -CallBase &CB, const std::vector &Candidates, -

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-10 Thread David Li via cfe-commits
@@ -276,35 +626,154 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( -CallBase &CB, const std::vector &Candidates, -

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance of weights" (PR #95136)

2024-06-11 Thread David Li via cfe-commits
david-xl wrote: What is the summary of the new changes that address the compile time issue? https://github.com/llvm/llvm-project/pull/95136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread David Li via cfe-commits
@@ -241,9 +264,11 @@ void scaleProfData(Instruction &I, uint64_t S, uint64_t T) { if (ProfDataName->getString() == "branch_weights" && ProfileData->getNumOperands() > 0) { // Using APInt::div may be expensive, but most cases should fit 64 bits. -APInt Val(128,

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -1393,16 +1398,27 @@ MDNode *getPGOFuncNameMetadata(const Function &F) { return F.getMetadata(getPGOFuncNameMetadataName()); } -void createPGOFuncNameMetadata(Function &F, StringRef PGOFuncName) { - // Only for internal linkage functions. - if (PGOFuncName == F.getName(

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -321,14 +790,114 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -276,35 +626,154 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( -CallBase &CB, const std::vector &Candidates, -

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -276,35 +626,154 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( -CallBase &CB, const std::vector &Candidates, -

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -103,30 +110,220 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -103,27 +114,226 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// Indirect call promotion pass will fall back to function-based comparison if +// vtable-count / function-

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-12 Thread David Li via cfe-commits
@@ -321,14 +746,127 @@ bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) { if (!NumCandidates || (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount))) continue; + auto PromotionCandidates = getPromotionCandidatesForCallSite

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-06-13 Thread David Li via cfe-commits
https://github.com/david-xl approved this pull request. https://github.com/llvm/llvm-project/pull/81442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-05-28 Thread David Li via cfe-commits
@@ -89,41 +93,50 @@ // ICTEXT: # NumValueSites: // ICTEXT: 2 // ICTEXT: 2 -// ICTEXT: {{.*}}instrprof-vtable-value-prof.cpp;_ZN12_GLOBAL__N_18Derived25func1Eii:750 -// ICTEXT: _ZN8Derived15func1Eii:250 +// ICTEXT: {{.*}}instrprof-vtable-value-prof.cpp;_ZN12_GLOBAL__N_18Derive

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-05-28 Thread David Li via cfe-commits
@@ -89,41 +93,50 @@ // ICTEXT: # NumValueSites: // ICTEXT: 2 // ICTEXT: 2 -// ICTEXT: {{.*}}instrprof-vtable-value-prof.cpp;_ZN12_GLOBAL__N_18Derived25func1Eii:750 -// ICTEXT: _ZN8Derived15func1Eii:250 +// ICTEXT: {{.*}}instrprof-vtable-value-prof.cpp;_ZN12_GLOBAL__N_18Derive

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-05-28 Thread David Li via cfe-commits
@@ -103,30 +110,222 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-05-28 Thread David Li via cfe-commits
@@ -103,30 +110,222 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-05-28 Thread David Li via cfe-commits
@@ -103,30 +110,222 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-05-28 Thread David Li via cfe-commits
@@ -103,30 +110,222 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-05-28 Thread David Li via cfe-commits
@@ -316,6 +316,15 @@ void salvageDebugInfoForDbgValues(Instruction &I, ArrayRef Insns, ArrayRef DPInsns); +void tryToSinkInstructionDbgValues( david-xl wrote: Add description for the methods.

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-05-28 Thread David Li via cfe-commits
@@ -103,30 +110,222 @@ static cl::opt ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens")); +// This option is meant to be used by LLVM regression test and test the +// transformation that compares vt

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-05-28 Thread David Li via cfe-commits
@@ -2538,6 +2538,190 @@ Value *getSalvageOpsForIcmpOp(ICmpInst *Icmp, uint64_t CurrentLocOps, return Icmp->getOperand(0); } +void llvm::tryToSinkInstructionDbgValues( david-xl wrote: is there test coverage for this? https://github.com/llvm/llvm-project/pu

[clang] [compiler-rt] [llvm] [TypeProf][InstrFDO]Implement more efficient comparison sequence for indirect-call-promotion with vtable profiles. (PR #81442)

2024-05-28 Thread David Li via cfe-commits
@@ -1967,11 +1969,23 @@ void llvm::updateProfileCallee( uint64_t CloneEntryCount = PriorEntryCount - NewEntryCount; for (auto Entry : *VMap) { if (isa(Entry.first)) -if (auto *CI = dyn_cast_or_null(Entry.second)) +if (auto *CI = dyn_cast_or_null(En

[clang] [clang] Add flag to experiment with cold function attributes (PR #88793)

2024-04-16 Thread David Li via cfe-commits
david-xl wrote: Is there a need for a small test case? https://github.com/llvm/llvm-project/pull/88793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Try to use non-volatile registers for `preserve_none` parameters (PR #88333)

2024-04-29 Thread David Li via cfe-commits
david-xl wrote: > The Windows x64 Buildkite CI job is failing, but I can't find any failed > tests in the downloaded logs. Any advice? You can download the raw log file from the details view. From the log, it looks like not related to this change -- the flang build run out of heap space: C:\B

[clang] [llvm] [llvm][misexpect] Update MisExpect to use provenance tracking metadata (PR #86610)

2024-07-09 Thread David Li via cfe-commits
https://github.com/david-xl approved this pull request. https://github.com/llvm/llvm-project/pull/86610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [profile] Add `%b` `LLVM_PROFILE_FILE` option for binary ID (PR #123963)

2025-02-03 Thread David Li via cfe-commits
@@ -855,6 +856,15 @@ static int parseFilenamePattern(const char *FilenamePat, FilenamePat); return -1; } + } else if (FilenamePat[I] == 'b') { +if (!NumBinaryIds++) { + if (__llvm_write_binary_ids(NULL) <= 0) { ---

[clang] [compiler-rt] [profile] Add `%b` `LLVM_PROFILE_FILE` option for binary ID (PR #123963)

2025-02-03 Thread David Li via cfe-commits
@@ -0,0 +1,37 @@ +// REQUIRES: linux +// RUN: split-file %s %t.dir +// RUN: %clang_profgen -Wl,--build-id=sha1 -o %t.dir/foo %t.dir/foo.c +// RUN: %clang_profgen -Wl,--build-id=sha1 -o %t.dir/bar %t.dir/bar.c + +// Check that foo and bar have the same signatures. +// RUN: rm -rf %

[clang] [compiler-rt] [profile] Add `%b` `LLVM_PROFILE_FILE` option for binary ID (PR #123963)

2025-02-05 Thread David Li via cfe-commits
@@ -2917,7 +2918,7 @@ instrumentation: $ LLVM_PROFILE_FILE="code-%m.profraw" ./code See `this `_ section - about the ``%t``, and ``%c`` modifiers. + about the ``%b``, ``%t``, and ``%c`` modifiers. david-xl wrote: better add an %b use example here

[clang] [compiler-rt] [profile] Add `%b` `LLVM_PROFILE_FILE` option for binary ID (PR #123963)

2025-02-05 Thread David Li via cfe-commits
https://github.com/david-xl approved this pull request. https://github.com/llvm/llvm-project/pull/123963 ___ 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-08 Thread David Li 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 David Li via cfe-commits
@@ -3035,6 +3035,38 @@ indexed format, regardeless whether it is produced by frontend or the IR pass. overhead. ``prefer-atomic`` will be transformed to ``atomic`` when supported by the target, or ``single`` otherwise. +.. option:: -fprofile-generate-temporal

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

2025-01-09 Thread David Li via cfe-commits
https://github.com/david-xl commented: 'generate' and 'instrumentation' seem redundant to each other. The user manual needs update too. https://github.com/llvm/llvm-project/pull/122385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [PGO] Add a clang option -fprofile-continuous that enables PGO continuous mode (PR #124353)

2025-01-24 Thread David Li via cfe-commits
@@ -3033,6 +3033,14 @@ indexed format, regardeless whether it is produced by frontend or the IR pass. overhead. ``prefer-atomic`` will be transformed to ``atomic`` when supported by the target, or ``single`` otherwise. +.. option:: -fprofile-continuous da

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

2025-01-03 Thread David Li via cfe-commits
https://github.com/david-xl commented: Is the plan to reuse the clang option -forder-file-instrumentation in the future? https://github.com/llvm/llvm-project/pull/121514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

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

2025-01-03 Thread David Li via cfe-commits
https://github.com/david-xl approved this pull request. 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] [InstrProf] Add frontend temporal profiling flag (PR #122385)

2025-01-10 Thread David Li via cfe-commits
https://github.com/david-xl approved this pull request. 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

r305325 - Preserve cold attribute for function decls

2017-06-13 Thread Xinliang David Li via cfe-commits
Author: davidxl Date: Tue Jun 13 16:14:07 2017 New Revision: 305325 URL: http://llvm.org/viewvc/llvm-project?rev=305325&view=rev Log: Preserve cold attribute for function decls Differential Revision: http://reviews.llvm.org/D34133 Modified: cfe/trunk/lib/CodeGen/CGCall.cpp cfe/trunk/te

Re: [PATCH] D36562: [Bitfield] Make the bitfield a separate location if it has width of legal integer type and its bit offset is naturally aligned for the type

2017-09-03 Thread Xinliang David Li via cfe-commits
Store forwarding stall cost is usually much higher compared with a load hitting L1 cache. For instance, on Haswell, the latter is ~4 cycles, while the store forwarding stalls cost about 10 cycles more than a successful store forwarding, which is roughly 15 cycles. In some scenarios, the store forw

Re: [PATCH] D36562: [Bitfield] Make the bitfield a separate location if it has width of legal integer type and its bit offset is naturally aligned for the type

2017-09-03 Thread Xinliang David Li via cfe-commits
I think we can think this in another way. For modern CPU architectures which supports store forwarding with store queues, it is generally not "safe" to blindly do local optimizations to widen the load/stores without sophisticated inter-procedural analysis. Doing so will run the risk of greatly red

Re: [PATCH] D36562: [Bitfield] Make the bitfield a separate location if it has width of legal integer type and its bit offset is naturally aligned for the type

2017-09-03 Thread Xinliang David Li via cfe-commits
On Sun, Sep 3, 2017 at 9:23 PM, Hal Finkel wrote: > > On 09/03/2017 11:06 PM, Xinliang David Li wrote: > > I think we can think this in another way. > > For modern CPU architectures which supports store forwarding with store > queues, it is generally not "safe" to blindly do local optimizations t

Re: [PATCH] D36562: [Bitfield] Make the bitfield a separate location if it has width of legal integer type and its bit offset is naturally aligned for the type

2017-09-04 Thread Xinliang David Li via cfe-commits
On Mon, Sep 4, 2017 at 9:17 AM, Hal Finkel wrote: > > On 09/04/2017 03:57 AM, Chandler Carruth wrote: > > On Sun, Sep 3, 2017 at 10:41 PM Hal Finkel via llvm-commits < > llvm-comm...@lists.llvm.org> wrote: > >> Nevertheless, I think that you've convinced me that this is a least-bad >> solution. I

Re: [PATCH] D36562: [Bitfield] Make the bitfield a separate location if it has width of legal integer type and its bit offset is naturally aligned for the type

2017-09-04 Thread Xinliang David Li via cfe-commits
On Mon, Sep 4, 2017 at 1:57 AM, Chandler Carruth wrote: > On Sun, Sep 3, 2017 at 10:41 PM Hal Finkel via llvm-commits < > llvm-comm...@lists.llvm.org> wrote: > >> Nevertheless, I think that you've convinced me that this is a least-bad >> solution. I'll want a flag preserving the old behavior. Som

Re: [PATCH] D63155: [clang][NewPM] Fix broken profile test

2019-06-28 Thread Xinliang David Li via cfe-commits
I agree that the test coverage needs to be improved eg better check etc. David On Fri, Jun 28, 2019 at 5:21 PM Chandler Carruth via Phabricator via llvm-commits wrote: > chandlerc added a comment. > > In D63155#1563275 , @xur wrote: > > > In D63155#156

Re: [PATCH] D45454: Make __gcov_flush visible outside a shared library

2018-06-25 Thread Xinliang David Li via cfe-commits
I don't have an objection having another interface which is just a simple wrapper to __gcov_flush but with default visibility. Also clearly document its usage and behavior. David On Mon, Jun 25, 2018 at 10:12 AM, Chih-Hung Hsieh via Phabricator via llvm-commits wrote: > chh added a comment. > >

Re: [PATCH] D84782: [PGO] Include the mem ops into the function hash.

2020-07-29 Thread Xinliang David Li via cfe-commits
right. It occurred to me during review, but did not think of the hard coded values in proftext depends on LE. On Wed, Jul 29, 2020 at 3:04 PM Hiroshi Yamauchi via Phabricator < revi...@reviews.llvm.org> wrote: > yamauchi added a comment. > > Builtbot failure: > http://lab.llvm.org:8011/builders/c

Re: [PATCH] D84261: [PGO] Supporting code for always instrumenting entry block

2020-08-17 Thread Xinliang David Li via cfe-commits
I think you are right -- the two files need to be in sync. On Mon, Aug 17, 2020 at 1:17 PM Pavel Kosov via Phabricator via llvm-commits wrote: > kpdev42 added inline comments. > > > > Comment at: llvm/include/llvm/ProfileData/InstrProfData.inc:676 > #define VARIANT_MASK_CSIR_PR

Re: [PATCH] D36562: [Bitfield] Make the bitfield a separate location if it has width of legal integer type and its bit offset is naturally aligned for the type

2017-08-22 Thread Xinliang David Li via cfe-commits
On Tue, Aug 22, 2017 at 6:37 PM, Chandler Carruth via Phabricator < revi...@reviews.llvm.org> wrote: > chandlerc added a comment. > > I'm really not a fan of the degree of complexity and subtlety that this > introduces into the frontend, all to allow particular backend optimizations. > > I feel li

Re: [PATCH] D36562: [Bitfield] Make the bitfield a separate location if it has width of legal integer type and its bit offset is naturally aligned for the type

2017-08-22 Thread Xinliang David Li via cfe-commits
On Tue, Aug 22, 2017 at 7:10 PM, Chandler Carruth via llvm-commits < llvm-comm...@lists.llvm.org> wrote: > On Tue, Aug 22, 2017 at 7:03 PM Xinliang David Li via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> On Tue, Aug 22, 2017 at 6:37 PM, Chandler Carrut

Re: [PATCH] D36562: [Bitfield] Make the bitfield a separate location if it has width of legal integer type and its bit offset is naturally aligned for the type

2017-08-22 Thread Xinliang David Li via cfe-commits
lists.llvm.org> wrote: >> >>> On Tue, Aug 22, 2017 at 7:03 PM Xinliang David Li via cfe-commits < >>> cfe-commits@lists.llvm.org> wrote: >>> >>>> On Tue, Aug 22, 2017 at 6:37 PM, Chandler Carruth via Phabricator < >>>> revi...@revi

Re: [PATCH] D104099: [NewPM] Remove SpeculateAroundPHIs pass from pipeline

2021-06-14 Thread Xinliang David Li via cfe-commits
On Mon, Jun 14, 2021 at 3:59 PM Roman Lebedev via Phabricator < revi...@reviews.llvm.org> wrote: > lebedev.ri added a subscriber: MaskRay. > lebedev.ri added a comment. > > In D104099#2815531 , @wenlei > wrote: > > > In D104099#2814167

Re: [PATCH] D45454: Make __gcov_flush visible outside a shared library

2018-04-11 Thread Xinliang David Li via cfe-commits
On Wed, Apr 11, 2018 at 11:31 AM, Chih-Hung Hsieh via Phabricator via llvm-commits wrote: > chh added a comment. > > Yes, calling `__gcov_flush` within .so files are different, > but it's a revert of https://reviews.llvm.org/D38124. > I think https://bugs.llvm.org/show_bug.cgi?id=27224 > can be

r300279 - [Profile] PE binary coverage bug fix

2017-04-13 Thread Xinliang David Li via cfe-commits
Author: davidxl Date: Thu Apr 13 18:37:21 2017 New Revision: 300279 URL: http://llvm.org/viewvc/llvm-project?rev=300279&view=rev Log: [Profile] PE binary coverage bug fix PR/32584 Differential Revision: https://reviews.llvm.org/D32023 Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp

r300301 - Remove unused function /nfc

2017-04-13 Thread Xinliang David Li via cfe-commits
Author: davidxl Date: Thu Apr 13 22:01:25 2017 New Revision: 300301 URL: http://llvm.org/viewvc/llvm-project?rev=300301&view=rev Log: Remove unused function /nfc Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp URL: http://llvm.or

r300304 - Fix use after free error

2017-04-13 Thread Xinliang David Li via cfe-commits
Author: davidxl Date: Thu Apr 13 23:14:29 2017 New Revision: 300304 URL: http://llvm.org/viewvc/llvm-project?rev=300304&view=rev Log: Fix use after free error Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp URL: http://llvm.org/v

Re: [PATCH] D13319: Eliminate __llvm_profile_register calls

2015-09-30 Thread Xinliang David Li via cfe-commits
On Wed, Sep 30, 2015 at 5:42 PM, Justin Bogner wrote: > David Li writes: >> davidxl created this revision. >> davidxl added reviewers: bogner, rsmith. >> davidxl added subscribers: cfe-commits, llvm-commits. >> Herald added subscribers: srhines, danalbert, tberghammer. >> >> With PGO, the instrum

Re: [PATCH] D13326: [PGO]: Eliminate __llvm_profile_register calls for Linux (clang changes)

2015-10-06 Thread Xinliang David Li via cfe-commits
Clang FE refactoring change is not needed anymore. In commit 0d32e7d952bc80830183e0c2c6ec5027ca6b1450, Vasileios Kalintiris did the same thing for multi-lib support. David On Tue, Oct 6, 2015 at 12:13 AM, Justin Bogner wrote: > David Li writes: >> davidxl updated this revision to Diff 36316. >

Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-08-26 Thread Xinliang David Li via cfe-commits
On Wed, Aug 26, 2015 at 11:11 AM, Eric Fiselier wrote: > EricWF added a comment. > > In http://reviews.llvm.org/D12247#233323, @davidxl wrote: > >> We certainly need a fix without breaking ABI. Is there a ABI conformance >> test for libcxx? > > > Well this patch definitely breaks the ABI. This wa

Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-08-26 Thread Xinliang David Li via cfe-commits
On Wed, Aug 26, 2015 at 3:38 PM, Eric Fiselier wrote: > EricWF added a comment. > > In http://reviews.llvm.org/D12247#233717, @yiranwang wrote: > >> Hi Eric, >> >> Could you please explain a bit more what is broken specifically? As we can >> see, sizeof(), _Len, and _Align, and alignof() of "alig

Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-08-27 Thread Xinliang David Li via cfe-commits
On Thu, Aug 27, 2015 at 2:57 PM, Yiran Wang wrote: > yiranwang added a comment. > > In http://reviews.llvm.org/D12247#234533, @EricWF wrote: > >> So this patch LGTM. Sorry for being slow to understand it. However I want to >> see two things before it lands. >> >> 1. I would like to see a test of

r250994 - clang driver toolchain refactoring

2015-10-21 Thread Xinliang David Li via cfe-commits
Author: davidxl Date: Thu Oct 22 01:15:31 2015 New Revision: 250994 URL: http://llvm.org/viewvc/llvm-project?rev=250994&view=rev Log: clang driver toolchain refactoring In this patch, the file static method addProfileRT is moved to be a virtual member function of base ToolChain class. This allows

r251072 - Use newly introduced interfaces in LLVM (NFC)

2015-10-22 Thread Xinliang David Li via cfe-commits
Author: davidxl Date: Thu Oct 22 17:25:11 2015 New Revision: 251072 URL: http://llvm.org/viewvc/llvm-project?rev=251072&view=rev Log: Use newly introduced interfaces in LLVM (NFC) Replaced references to raw strings in instrumentation and coverage code. Modified: cfe/trunk/lib/CodeGen/CodeGen

Re: [PATCH] D14030: Use linker option to reference profile runtime hook (Linux)

2015-10-26 Thread Xinliang David Li via cfe-commits
On Mon, Oct 26, 2015 at 8:44 AM, Vedant Kumar wrote: > vsk added a comment. > > This looks good to me. Does this mean we will get rid of > `getInstrProfRuntimeHookVarUseFuncName`? > not yet -- note that this is only enabled for Linux toolchain only for now. If it works for all platforms, we can

r251385 - Create undef reference to profile hook symbol

2015-10-26 Thread Xinliang David Li via cfe-commits
Author: davidxl Date: Tue Oct 27 00:15:35 2015 New Revision: 251385 URL: http://llvm.org/viewvc/llvm-project?rev=251385&view=rev Log: Create undef reference to profile hook symbol Create undef reference to profile hook symbol when PGO instrumentation is turned on. This allows LLVM to omit emiss

<    1   2   3   4   >