[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -537,6 +538,9 @@ class SampleContext { assert(!Name.empty() && "Name is empty"); } + SampleContext(ProfileFuncRef Name) david-xl wrote: Name ->Func https://github.com/llvm/llvm-project/pull/66164

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -0,0 +1,225 @@ +//===--- ProfileFuncRef.h - Sample profile function name ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -1048,27 +1052,29 @@ class FunctionSamples { }; if (isDeclaration(SymbolMap.lookup(getFuncName( { // Add to the import list only when it's defined out of module. - S.insert(getGUID(getName())); + S.insert(getGUID()); } // Import hot Call

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -1048,27 +1052,29 @@ class FunctionSamples { }; if (isDeclaration(SymbolMap.lookup(getFuncName( { // Add to the import list only when it's defined out of module. - S.insert(getGUID(getName())); + S.insert(getGUID()); } // Import hot Call

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -643,14 +648,11 @@ class SampleContext { uint64_t getHashCode() const { if (hasContext()) return hash_value(getContextFrames()); - -// For non-context function name, use its MD5 as hash value, so that it is -// consistent with the profile map's key. -

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -0,0 +1,225 @@ +//===--- ProfileFuncRef.h - Sample profile function name ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -574,7 +578,7 @@ class SampleContext { ContextStr = ContextStr.substr(1, ContextStr.size() - 2); StringRef ContextRemain = ContextStr; StringRef ChildContext; -StringRef CalleeName; +ProfileFuncRef CalleeName; david-xl wrote: CalleeName

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -0,0 +1,226 @@ +//===--- ProfileFuncRef.h - Sample profile function name ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -1048,27 +1052,29 @@ class FunctionSamples { }; if (isDeclaration(SymbolMap.lookup(getFuncName( { // Add to the import list only when it's defined out of module. - S.insert(getGUID(getName())); + S.insert(getGUID()); } // Import hot Call

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -715,7 +717,7 @@ class SampleContext { private: /// Mangled name of the function. - StringRef Name; + ProfileFuncRef Name; david-xl wrote: Name --> Func https://github.com/llvm/llvm-project/pull/66164 ___ cf

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -1135,12 +1141,12 @@ class FunctionSamples { /// translate \p Name in current FunctionSamples into its original name /// by looking up in the function map GUIDToFuncNameMap. /// If the original name doesn't exist in the map, return empty StringRef. - StringRef getFunc

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -0,0 +1,225 @@ +//===--- ProfileFuncRef.h - Sample profile function name ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -574,7 +578,7 @@ class SampleContext { ContextStr = ContextStr.substr(1, ContextStr.size() - 2); StringRef ContextRemain = ContextStr; StringRef ChildContext; -StringRef CalleeName; +ProfileFuncRef CalleeName; david-xl wrote: CalleeName

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -643,14 +648,11 @@ class SampleContext { uint64_t getHashCode() const { if (hasContext()) return hash_value(getContextFrames()); - -// For non-context function name, use its MD5 as hash value, so that it is -// consistent with the profile map's key. -

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-20 Thread David Li via cfe-commits
@@ -0,0 +1,226 @@ +//===--- ProfileFuncRef.h - Sample profile function name ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-09-21 Thread David Li via cfe-commits
@@ -124,9 +124,27 @@ int __llvm_profile_merge_from_buffer(const char *ProfileData, SrcCountersEnd = SrcCountersStart + Header->NumCounters * __llvm_profile_counter_entry_size(); SrcNameStart = SrcCountersEnd; - SrcValueProfDataStart = + // This is to a

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-09-21 Thread David Li via cfe-commits
@@ -272,18 +279,26 @@ lprofWriteDataImpl(ProfDataWriter *Writer, const __llvm_profile_data *DataBegin, const uint64_t NumCounters = __llvm_profile_get_num_counters(CountersBegin, CountersEnd); const uint64_t NamesSize = DebugInfoCorrelate ? 0 : NamesEnd - NamesBegin;

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-09-21 Thread David Li via cfe-commits
@@ -92,6 +92,19 @@ INSTR_PROF_DATA(const uint16_t, Int16ArrayTy, NumValueSites[IPVK_Last+1], \ /* INSTR_PROF_DATA end. */ +#ifndef INSTR_PROF_VTABLE_DATA +#define INSTR_PROF_VTABLE_DATA(Type, LLVMType, Name, Initializer) +#else +#define INSTR_PROF_VTABLE_DATA_DEFINED +#endif

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-09-21 Thread David Li via cfe-commits
@@ -305,13 +320,24 @@ lprofWriteDataImpl(ProfDataWriter *Writer, const __llvm_profile_data *DataBegin, /* Write the profile header. */ ProfDataIOVec IOVec[] = {{&Header, sizeof(__llvm_profile_header), 1, 0}}; + // printf("Size of profile header is %d\n", + // (int)(size

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-09-21 Thread David Li via cfe-commits
@@ -686,9 +708,11 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure, than WIN32 */ #define INSTR_PROF_DATA_COMMON __llvm_prf_data #define INSTR_PROF_NAME_COMMON __llvm_prf_names +#define INSTR_PROF_VNAME_COMMON __llvm_prf_vnames david-xl wrote:

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-26 Thread David Li via cfe-commits
david-xl wrote: The change looks good to me, but wait for other reviewers to chime in as well. Also a good idea to run tests with sanitizers on. https://github.com/llvm/llvm-project/pull/66164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-27 Thread David Li via cfe-commits
@@ -1048,27 +1052,29 @@ class FunctionSamples { }; if (isDeclaration(SymbolMap.lookup(getFuncName( { // Add to the import list only when it's defined out of module. - S.insert(getGUID(getName())); + S.insert(getGUID()); } // Import hot Call

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-09-27 Thread David Li via cfe-commits
@@ -1048,27 +1052,29 @@ class FunctionSamples { }; if (isDeclaration(SymbolMap.lookup(getFuncName( { // Add to the import list only when it's defined out of module. - S.insert(getGUID(getName())); + S.insert(getGUID()); } // Import hot Call

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-10-09 Thread David Li via cfe-commits
https://github.com/david-xl commented: Is there a need to have a separate vtable name section? Merging the vtable names with function name table can make the implementation simpler. https://github.com/llvm/llvm-project/pull/66825 ___ cfe-commits mail

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-10-09 Thread David Li via cfe-commits
@@ -177,13 +195,22 @@ VALUE_PROF_FUNC_PARAM(uint32_t, CounterIndex, Type::getInt32Ty(Ctx)) VALUE_PROF_KIND(IPVK_IndirectCallTarget, 0, "indirect call target") /* For memory intrinsic functions size profiling. */ VALUE_PROF_KIND(IPVK_MemOPSize, 1, "memory intrinsic functions si

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-10-09 Thread David Li via cfe-commits
https://github.com/david-xl edited https://github.com/llvm/llvm-project/pull/66825 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-10-09 Thread David Li via cfe-commits
https://github.com/david-xl commented: Is there a need to have a separate vtable name section? Merging the vtable names with function name table can make the implementation simpler. https://github.com/llvm/llvm-project/pull/66825 ___ cfe-commits mail

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread David Li via cfe-commits
@@ -902,12 +890,16 @@ std::error_code SampleProfileReaderExtBinaryBase::readFuncProfiles() { for (const auto &NameOffset : FuncOffsetList) { const auto &FContext = NameOffset.first; auto FName = FContext.getName(); +StringRef FNameString; +

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread David Li via cfe-commits
@@ -902,12 +890,16 @@ std::error_code SampleProfileReaderExtBinaryBase::readFuncProfiles() { for (const auto &NameOffset : FuncOffsetList) { const auto &FContext = NameOffset.first; auto FName = FContext.getName(); +StringRef FNameString; +

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread David Li via cfe-commits
@@ -902,12 +890,16 @@ std::error_code SampleProfileReaderExtBinaryBase::readFuncProfiles() { for (const auto &NameOffset : FuncOffsetList) { const auto &FContext = NameOffset.first; auto FName = FContext.getName(); +StringRef FNameString;

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread David Li via cfe-commits
@@ -0,0 +1,129 @@ +//===--- HashKeyMap.h - Wrapper for maps using hash value key ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread David Li via cfe-commits
@@ -902,12 +890,16 @@ std::error_code SampleProfileReaderExtBinaryBase::readFuncProfiles() { for (const auto &NameOffset : FuncOffsetList) { const auto &FContext = NameOffset.first; auto FName = FContext.getName(); +StringRef FNameString; +

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread David Li via cfe-commits
@@ -902,12 +890,16 @@ std::error_code SampleProfileReaderExtBinaryBase::readFuncProfiles() { for (const auto &NameOffset : FuncOffsetList) { const auto &FContext = NameOffset.first; auto FName = FContext.getName(); +StringRef FNameString; +

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread David Li via cfe-commits
@@ -0,0 +1,129 @@ +//===--- HashKeyMap.h - Wrapper for maps using hash value key ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [IRPGO][ValueProfile] Instrument virtual table address that could be used to do virtual table address comparision for indirect-call-promotion. (PR #66825)

2023-10-12 Thread David Li via cfe-commits
david-xl wrote: The performance win depends a lot on value distribution. For large copies, using SIMD with nontemporal hint is the way to go. https://github.com/llvm/llvm-project/pull/66825 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-12 Thread David Li via cfe-commits
@@ -0,0 +1,222 @@ +//===--- ProfileFuncRef.h - Sample profile function name ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-12 Thread David Li via cfe-commits
@@ -902,12 +890,16 @@ std::error_code SampleProfileReaderExtBinaryBase::readFuncProfiles() { for (const auto &NameOffset : FuncOffsetList) { const auto &FContext = NameOffset.first; auto FName = FContext.getName(); +StringRef FNameString;

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-12 Thread David Li via cfe-commits
@@ -0,0 +1,222 @@ +//===--- ProfileFuncRef.h - Sample profile function name ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2

[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-12 Thread David Li via cfe-commits
@@ -902,12 +890,16 @@ std::error_code SampleProfileReaderExtBinaryBase::readFuncProfiles() { for (const auto &NameOffset : FuncOffsetList) { const auto &FContext = NameOffset.first; auto FName = FContext.getName(); +StringRef FNameString; +

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-12 Thread David Li via cfe-commits
@@ -902,12 +890,16 @@ std::error_code SampleProfileReaderExtBinaryBase::readFuncProfiles() { for (const auto &NameOffset : FuncOffsetList) { const auto &FContext = NameOffset.first; auto FName = FContext.getName(); +StringRef FNameString; +

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-12 Thread David Li via cfe-commits
@@ -902,12 +890,16 @@ std::error_code SampleProfileReaderExtBinaryBase::readFuncProfiles() { for (const auto &NameOffset : FuncOffsetList) { const auto &FContext = NameOffset.first; auto FName = FContext.getName(); +StringRef FNameString; +

[clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2023-10-13 Thread David Li via cfe-commits
@@ -27,10 +27,12 @@ class FileSystem; struct PGOOptions { enum PGOAction { NoAction, IRInstr, IRUse, SampleUse }; enum CSPGOAction { NoCSAction, CSIRInstr, CSIRUse }; + enum class ColdFuncAttr { None, OptSize, MinSize, OptNone }; david-xl wrote: Even thou

[clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2023-10-13 Thread David Li via cfe-commits
@@ -44,6 +46,7 @@ struct PGOOptions { std::string MemoryProfile; PGOAction Action; CSPGOAction CSAction; + ColdFuncAttr ColdType; david-xl wrote: ColdType --> ColdOptType https://github.com/llvm/llvm-project/pull/69030 _

[clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2023-10-13 Thread David Li via cfe-commits
@@ -27,10 +27,12 @@ class FileSystem; struct PGOOptions { enum PGOAction { NoAction, IRInstr, IRUse, SampleUse }; enum CSPGOAction { NoCSAction, CSIRInstr, CSIRUse }; + enum class ColdFuncAttr { None, OptSize, MinSize, OptNone }; david-xl wrote: None -->

[clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2023-10-13 Thread David Li via cfe-commits
@@ -0,0 +1,65 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2023-10-13 Thread David Li via cfe-commits
@@ -202,6 +202,18 @@ static cl::opt cl::desc("Path to the profile remapping file."), cl::Hidden); +static cl::opt PGOColdFuncAttr( +"pgo-cold-func-attr", cl::init(PGOOptions::ColdFuncAttr::None), cl::Hidden, ---

[clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

2023-10-16 Thread David Li via cfe-commits
@@ -0,0 +1,65 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[clang-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-16 Thread David Li via cfe-commits
https://github.com/david-xl approved this pull request. https://github.com/llvm/llvm-project/pull/66164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24097: Add testcases for PR30188

2016-08-31 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: clang/test/CodeGen/pr30188.c:3 @@ +2,3 @@ + +// Check that optimizers are able to optimize the number of loads in the loop. +// CHECK: load Can you just do ... | grep load | count 3 Comment at: clang/

[PATCH] D12716: Reduce PGO Instrumentation binary and profile data size (Patch-2)

2015-09-08 Thread David Li via cfe-commits
davidxl created this revision. davidxl added reviewers: cfe-commits, bogner, silvas, xur. See patch-1 for description http://reviews.llvm.org/D12716 Files: include/clang/Driver/Options.td include/clang/Frontend/CodeGenOptions.def include/clang/Frontend/CodeGenOptions.h lib/CodeGen/Backen

[PATCH] D13319: Eliminate __llvm_profile_register calls

2015-09-30 Thread David Li via cfe-commits
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 instrumented binary needs to dump __llvm_prf_data, __llvm_prf_cnts, and __llvm_prf_names data sect

Re: [PATCH] D13319: Eliminate __llvm_profile_register calls

2015-09-30 Thread David Li via cfe-commits
davidxl added a comment. With this patch, 11M bytes (text section) can be shaved off clang build with instrumentation. http://reviews.llvm.org/D13319 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/list

Re: [PATCH] D13319: Eliminate __llvm_profile_register calls

2015-09-30 Thread David Li via cfe-commits
davidxl abandoned this revision. davidxl added a comment. Will split the patch into 3. http://reviews.llvm.org/D13319 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2015-09-30 Thread David Li via cfe-commits
davidxl created this revision. davidxl added reviewers: rsmith, bogner. davidxl added a subscriber: cfe-commits. Herald added subscribers: srhines, danalbert, tberghammer. This is the patch-1. Driver tests are also added. See http://reviews.llvm.org/D13319 for description. http://reviews.llvm.or

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

2015-09-30 Thread David Li via cfe-commits
davidxl removed subscribers: tberghammer, danalbert, srhines. davidxl updated this revision to Diff 36186. http://reviews.llvm.org/D13326 Files: include/clang/Driver/ToolChain.h lib/Driver/SanitizerArgs.cpp lib/Driver/ToolChain.cpp lib/Driver/ToolChains.cpp lib/Driver/ToolChains.h lib

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

2015-09-30 Thread David Li via cfe-commits
davidxl updated this revision to Diff 36190. davidxl added a comment. fix broken test (by clang-format). http://reviews.llvm.org/D13326 Files: include/clang/Driver/ToolChain.h lib/Driver/SanitizerArgs.cpp lib/Driver/ToolChain.cpp lib/Driver/ToolChains.cpp lib/Driver/ToolChains.h lib

Re: [PATCH] D11908: Clang support for -fthinlto.

2015-10-01 Thread David Li via cfe-commits
davidxl added a comment. ThinLTO is a perfectly good term to indicate what it tries to accomplish. InlineOnly will narrow its scope. For instance, there is no reason why thinLTO can not do fast summary based WPA in the future. http://reviews.llvm.org/D11908 _

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

2015-10-01 Thread David Li via cfe-commits
davidxl updated this revision to Diff 36316. davidxl added a comment. I have modified the implementation to not use linker script, so this clang patch becomes strictly refactoring with NFC. I think it is still a good thing to have this in so that similar tunings like this can be done in the futu

Re: [PATCH] D11908: Clang support for -fthinlto.

2015-08-13 Thread David Li via cfe-commits
davidxl added a subscriber: davidxl. Comment at: include/clang/Driver/Options.td:685 @@ -684,1 +684,3 @@ def fno_lto : Flag<["-"], "fno-lto">, Group; +def fthinlto : Flag<["-"], "fthinlto">, Flags<[CC1Option]>, Group; +def fno_thinlto : Flag<["-"], "fno-thinlto">, Group;

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

2015-08-26 Thread David Li via cfe-commits
davidxl added a subscriber: davidxl. davidxl added a comment. In libc++, placement new is used in many places. When selecting the buffer size for the placed object, it uses the 'actual' size of the buffer including the padding bytes from alignment, instead of the declared of the buffer. As a r

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

2015-08-26 Thread David Li via cfe-commits
davidxl added a comment. We certainly need a fix without breaking ABI. Is there a ABI conformance test for libcxx? http://reviews.llvm.org/D12247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo

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

2015-08-26 Thread David Li via cfe-commits
davidxl added a comment. yes -- the intention of Yiran's patch is not to change the size/alignment of the underlying storage, but to make the original padding space part of the type. http://reviews.llvm.org/D12247 ___ cfe-commits mailing list cfe-c

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

2015-10-13 Thread David Li via cfe-commits
davidxl abandoned this revision. davidxl added a comment. The refactoring is done by a previous patch already. http://reviews.llvm.org/D13326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

Re: [PATCH] D13326: [PGO]: ToolChain class refactoring: move addProfileRT to be a virtal method: ToolChain::addProfileRTLibs

2015-10-21 Thread David Li via cfe-commits
davidxl added a comment. It turns out previous refactoring by another commit only covers half of the work. Will update the patch with Justin's comments and commit after testing. http://reviews.llvm.org/D13326 ___ cfe-commits mailing list cfe-commi

Re: [PATCH] D13326: [PGO]: ToolChain class refactoring: move addProfileRT to be a virtal method: ToolChain::addProfileRTLibs

2015-10-21 Thread David Li via cfe-commits
davidxl updated this revision to Diff 38091. davidxl added a comment. Updated patch. http://reviews.llvm.org/D13326 Files: include/clang/Driver/ToolChain.h lib/Driver/ToolChain.cpp lib/Driver/ToolChains.cpp lib/Driver/ToolChains.h lib/Driver/Tools.cpp Index: lib/Driver/Tools.cpp

Re: [PATCH] D13326: [PGO]: ToolChain class refactoring: move addProfileRT to be a virtal method: ToolChain::addProfileRTLibs

2015-10-21 Thread David Li via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL250994: clang driver toolchain refactoring (authored by davidxl). Changed prior to commit: http://reviews.llvm.org/D13326?vs=38091&id=38092#toc Repository: rL LLVM http://reviews.llvm.org/D13326 Fi

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

2015-10-23 Thread David Li via cfe-commits
davidxl created this revision. davidxl added a reviewer: bogner. davidxl added a subscriber: cfe-commits. Currently when profile instrumentation is on, the compiler emits a runtime hook use function (__llvm_profile_runtime_use) for every module that is instrumented. The generated function refere

[PATCH] D22593: [Profile] document %h and %m

2016-07-20 Thread David Li via cfe-commits
davidxl created this revision. davidxl added reviewers: vsk, silvas. davidxl added a subscriber: cfe-commits. Added documentation for %h and %m specifiers. %m specifier which specifies the number of copies is not documented yet (treated as internal for now) https://reviews.llvm.org/D22593 File

Re: [PATCH] D22593: [Profile] document %h and %m

2016-07-20 Thread David Li via cfe-commits
davidxl updated this revision to Diff 64759. davidxl added a comment. Fixed a typo https://reviews.llvm.org/D22593 Files: docs/UsersManual.rst Index: docs/UsersManual.rst === --- docs/UsersManual.rst +++ docs/UsersManual.rst @@

Re: [PATCH] D22593: [Profile] document %h and %m

2016-07-20 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: docs/UsersManual.rst:1500 @@ +1499,3 @@ + name. When this specifier is used, the profiler runtime will substitute ``%m`` + with a unique integer identifier associated with the instrumented binary. Multiple + profiles dumped from

Re: [PATCH] D22593: [Profile] document %h and %m

2016-07-20 Thread David Li via cfe-commits
davidxl updated this revision to Diff 64793. davidxl added a comment. Addressed review comments. I still think %4m etc is an advanced feature that needs more explanation. We can delay that to a later time. https://reviews.llvm.org/D22593 Files: docs/UsersManual.rst Index: docs/UsersManual.

Re: [PATCH] D22593: [Profile] document %h and %m

2016-07-20 Thread David Li via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL276207: [Profile] Document new profile file name modifiers (authored by davidxl). Changed prior to commit: https://reviews.llvm.org/D22593?vs=64793&id=64794#toc Repository: rL LLVM https://reviews.l

Re: [PATCH] D22608: [Profile] Use a flag to enable PGO rather than the profraw filename.

2016-07-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 Repository: rL LLVM https://reviews.llvm.org/D22608 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-b

Re: [PATCH] D22608: [Profile] Use a flag to enable PGO rather than the profraw filename.

2016-07-22 Thread David Li via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL276517: [Profile] Use a flag to enable PGO rather than the profraw filename (authored by davidxl). Changed prior to commit: https://reviews.llvm.org/D22608?vs=64812&id=65216#toc Repository: rL LLVM

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

2016-02-05 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: include/clang/Frontend/CodeGenOptions.h:234 @@ +233,3 @@ + + /// \brief Check if IR profile instrumenation is on. + bool hasProfileIRInstr() const { typo: instrumentation http://reviews.llvm.org/D15829

[PATCH] D16947: [PGO] assignment operator does not get profile data

2016-02-06 Thread David Li via cfe-commits
davidxl created this revision. davidxl added a reviewer: vsk. davidxl added subscribers: llvm-commits, cfe-commits. For compiler generated assignment operator that is not trivial (calling base class operator=()), Clang FE assign region counters to the function body but does not emit profile coun

Re: [PATCH] D16947: [PGO] assignment operator does not get profile data

2016-02-07 Thread David Li via cfe-commits
davidxl updated this revision to Diff 47150. davidxl added a comment. Updated test case. Another test case in profile-rt (pending) is : http://reviews.llvm.org/D16974 http://reviews.llvm.org/D16947 Files: lib/CodeGen/CGClass.cpp test/Profile/def-assignop.cpp Index: test/Profile/def-assign

Re: [PATCH] D16947: [PGO] assignment operator does not get profile data

2016-02-08 Thread David Li via cfe-commits
davidxl updated this revision to Diff 47217. davidxl added a comment. Simplified test case suggested by Vedant. http://reviews.llvm.org/D16947 Files: lib/CodeGen/CGClass.cpp test/Profile/def-assignop.cpp Index: test/Profile/def-assignop.cpp =

Re: [PATCH] D16947: [PGO] assignment operator does not get profile data

2016-02-08 Thread David Li via cfe-commits
davidxl updated this revision to Diff 47239. davidxl added a comment. Further simplify tests according to David B's comment. http://reviews.llvm.org/D16947 Files: lib/CodeGen/CGClass.cpp test/Profile/def-assignop.cpp Index: test/Profile/def-assignop.cpp

Re: [PATCH] D16947: [PGO] assignment operator does not get profile data

2016-02-09 Thread David Li via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL260270: [PGO] Fix issue: explicitly defaulted assignop is not profiled (authored by davidxl). Changed prior to commit: http://reviews.llvm.org/D16947?vs=47239&id=47351#toc Repository: rL LLVM http:/

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

2016-02-18 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:150 @@ -149,2 +149,3 @@ - if (!CodeGenOpts.InstrProfileInput.empty()) { + if (!CodeGenOpts.hasProfileIRInstr() && + !CodeGenOpts.InstrProfileInput.empty()) { Better to use if (CodeGe

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

2016-02-23 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: include/clang/Frontend/CodeGenOptions.h:83 @@ -82,2 +82,3 @@ enum ProfileInstrKind { ProfileNoInstr,// No instrumentation. +ProfileClangInstr, // Clang instrumentation to generate execution counts Maybe Pr

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

2016-02-24 Thread David Li via cfe-commits
davidxl added a comment. Looks good to me -- and it makes the profile-gen and profile-use's cc1 option handling consistent. Please check with Sean or Justin just in case before proceeding. http://reviews.llvm.org/D15829 ___ cfe-commits mailing li

Re: [PATCH] D19612: Use the new path for coverage related headers and update CMakeLists.txt

2016-04-27 Thread David Li via cfe-commits
davidxl accepted this revision. davidxl added a reviewer: davidxl. davidxl added a comment. This revision is now accepted and ready to land. lgtm http://reviews.llvm.org/D19612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llv

Re: [PATCH] D19725: [Coverage] Fix an issue where a coverage region might not be created for a macro containing for or while statements.

2016-05-01 Thread David Li via cfe-commits
davidxl accepted this revision. davidxl added a comment. This revision is now accepted and ready to land. lgtm Comment at: lib/CodeGen/CoverageMappingGen.cpp:468 @@ +467,3 @@ +MostRecentLocation == getEndOfFileOrMacro(MostRecentLocation) && +isRegionAlreadyAdded(

Re: [PATCH] D20287: [Coverage] Ensure that the hash for a used function is non-zero.

2016-05-16 Thread David Li via cfe-commits
davidxl added a comment. Strictly speaking, this patch requires a version bump of the indexed format. The profile reader also needs to adjust the FunctionHash computation (either using 0 or simple function hash) based on the version of the profile data. Check with Justin/vsk to see if it is imp

Re: [PATCH] D18636: [PGO] Avoid instrumenting constants at value sites

2016-03-30 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/CodeGen/CodeGenPGO.cpp:758 @@ -757,1 +757,3 @@ + if (dyn_cast(ValuePtr)) +return; Is it the bitcast guaranteed to be already stripped here? Repository: rL LLVM http://reviews.llvm.org/D18636 ___

Re: [PATCH] D18624: [PGO] PGOFuncName meta data if PGOFuncName is different from function's raw name.

2016-04-15 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/CodeGen/CodeGenPGO.cpp:791 @@ +790,3 @@ +// Create PGOFuncName meta data. +llvm::Function *F = ValueSite->getFunction(); +if (!llvm::getPGOFuncNameMetadata(*F)) This may not be the best place do set the da

Re: [PATCH] D19299: lower __builtin_expect() directly to prof metadata instead of LLVM intrinsic

2016-04-19 Thread David Li via cfe-commits
davidxl added a comment. I like the direction this patch is going. Will look into details soon. http://reviews.llvm.org/D19299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D19299: lower __builtin_expect() directly to prof metadata instead of LLVM intrinsic

2016-04-20 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:636 @@ -640,1 +635,3 @@ + case Builtin::BI__builtin_unpredictable: case Builtin::BI__builtin_expect: { +// Always return the first argument. LLVM does not handle these builtins. Can this

Re: [PATCH] D18624: [PGO] PGOFuncName meta data if PGOFuncName is different from function's raw name.

2016-04-20 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/CodeGen/CodeGenPGO.cpp:47 @@ +46,3 @@ + // Create PGOFuncName meta data. + if (!llvm::getPGOFuncNameMetadata(*Fn)) +llvm::createPGOFuncNameMetadata(*Fn); This check be folded into the creator. The creator interf

Re: [PATCH] D19299: lower __builtin_expect() directly to prof metadata instead of LLVM intrinsic

2016-04-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/D19299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

Re: [PATCH] D18624: [PGO] PGOFuncName meta data if PGOFuncName is different from function's raw name.

2016-04-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 http://reviews.llvm.org/D18624 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

Re: [PATCH] D21823: [Driver] Add flags for enabling both types of PGO Instrumentation

2016-07-01 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: include/clang/Driver/Options.td:507 @@ +506,3 @@ +Group, Flags<[DriverOption]>, MetaVarName<"">, +HelpText<"Set to be the default profile output file (overridden by LLVM_PROFILE_FILE env var)">; +def fpgo_apply_EQ : Joined<["-"]

Re: [PATCH] D21823: [Driver] Add flags for enabling both types of PGO Instrumentation

2016-07-09 Thread David Li via cfe-commits
davidxl added a comment. I should have brought it up earlier, but I forgot.I think a better (and simpler) proposal is to make -fprofile-generate and -fprofile-use turn on IR based PGO. -fprofile-generate and -fprofile-use options were introduced by Diego (cc'ed) recently for GCC option com

Re: [PATCH] D21823: [Driver] Add flags for enabling both types of PGO Instrumentation

2016-07-12 Thread David Li via cfe-commits
davidxl added a comment. Please also update user manual: docs/UserManual.rst Comment at: test/Driver/clang_f_opts.c:90 @@ -89,3 +89,2 @@ // RUN: %clang -### -S -fprofile-instr-generate=file -fno-profile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s -//

Re: [PATCH] D21823: [Driver] Add flags for enabling both types of PGO Instrumentation

2016-07-12 Thread David Li via cfe-commits
davidxl added inline comments. Comment at: lib/Driver/Tools.cpp:3596 @@ -3576,3 +3595,3 @@ Args.hasFlag(options::OPT_fprofile_generate, -options::OPT_fno_profile_instr_generate, false) || +options::OPT_fno_profile_generate, false) ||

Re: [PATCH] D21823: [Driver] Add flags for enabling both types of PGO Instrumentation

2016-07-15 Thread David Li via cfe-commits
davidxl accepted this revision. davidxl added a comment. lgtm Repository: rL LLVM https://reviews.llvm.org/D21823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D17737: [PGO] change profile use cc1 option

2016-03-01 Thread David Li via cfe-commits
davidxl added a comment. I think we just need one cc1 option -fprofile-instrument-use-path=<>. An overloaded setPGOInstrumenter method can peak at the profile header and get the Profile flavor. http://reviews.llvm.org/D17737 ___ cfe-commits maili

Re: [PATCH] D17737: [PGO] change profile use cc1 option

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

<    1   2   3   4   >