[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-15 Thread William Junda Huang via cfe-commits
huangjd wrote: > @huangjd, I'm not sure the buildbot emails on failure are working, but the > test you added seems to be failing on many bots. Can you take a look and > revert if you need time to investigate? > > * https://lab.llvm.org/buildbot/#/builders/144/builds/163 > * https://lab.llvm.or

[clang] [Debug Info] Fix debug info ptr to ptr test (PR #95637)

2024-06-15 Thread William Junda Huang via cfe-commits
https://github.com/huangjd created https://github.com/llvm/llvm-project/pull/95637 Fix test case in #95298 because another recent submitted patch removed llvm.dbg intrinsics, updated test case accordingly >From 5fafbda01e5bf10b898f71b38305485e57e5b13f Mon Sep 17 00:00:00 2001 From: William Hua

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-14 Thread William Junda Huang via cfe-commits
https://github.com/huangjd closed https://github.com/llvm/llvm-project/pull/95298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-13 Thread William Junda Huang via cfe-commits
@@ -5746,6 +5746,57 @@ void CGDebugInfo::EmitExternalVariable(llvm::GlobalVariable *Var, Var->addDebugInfo(GVE); } +void CGDebugInfo::EmitPseudoVariable(CGBuilderTy &Builder, + llvm::Instruction *Value, QualType Ty) { + // Only when -g2

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-13 Thread William Junda Huang via cfe-commits
@@ -5746,6 +5746,57 @@ void CGDebugInfo::EmitExternalVariable(llvm::GlobalVariable *Var, Var->addDebugInfo(GVE); } +void CGDebugInfo::EmitPseudoVariable(CGBuilderTy &Builder, + llvm::Instruction *Value, QualType Ty) { + // Only when -g2

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-13 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/95298 >From 0c49ae55b4b05a9c701288f106c138cab4af37f0 Mon Sep 17 00:00:00 2001 From: William Huang Date: Wed, 12 Jun 2024 03:48:51 -0400 Subject: [PATCH 1/2] (New) Add option to generate additional debug info for expre

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-12 Thread William Junda Huang via cfe-commits
huangjd wrote: It seems the restriction for dbg.value appearing in the front end was lifted recently, so now I can just emit dbg.value directly https://github.com/llvm/llvm-project/pull/95298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-12 Thread William Junda Huang via cfe-commits
https://github.com/huangjd created https://github.com/llvm/llvm-project/pull/95298 This is a different implementation to #94100, which has been reverted. When -fdebug-info-for-profiling is specified, for any Load expression if the pointer operand is not a declared variable, clang will emit deb

[clang] Revert "Add option to generate additional debug info for expression dereferencing pointer to pointers. #94100" (PR #95174)

2024-06-11 Thread William Junda Huang via cfe-commits
https://github.com/huangjd closed https://github.com/llvm/llvm-project/pull/95174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "Add option to generate additional debug info for expression dereferencing pointer to pointers. #94100" (PR #95174)

2024-06-11 Thread William Junda Huang via cfe-commits
https://github.com/huangjd created https://github.com/llvm/llvm-project/pull/95174 The option is causing the binary output to be different when compiled under `-O0`, because it introduce dbg.declare on pseudovariables. Going to change this implementation to use dbg.value instead. >From c7

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #94100)

2024-06-11 Thread William Junda Huang via cfe-commits
huangjd wrote: Ok lets revert this first, and I will work on the dbg.value implementation https://github.com/llvm/llvm-project/pull/94100 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #94100)

2024-06-10 Thread William Junda Huang via cfe-commits
huangjd wrote: By just specifying `-g` Even without `-fdebug-info-for-profiling` it is going to introduce debug variables as a sequence of alloca-store-load too, so is it a requirement to guarantee `-O0` output stays identical with or without debug info? Emitting a dbg.value was what I origi

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #94100)

2024-06-03 Thread William Junda Huang via cfe-commits
https://github.com/huangjd closed https://github.com/llvm/llvm-project/pull/94100 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #94100)

2024-05-31 Thread William Junda Huang via cfe-commits
https://github.com/huangjd created https://github.com/llvm/llvm-project/pull/94100 This is another attempt to land #81545, which was reverted. Fixed test case so that it is consistent on all platforms. >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huan

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-31 Thread William Junda Huang via cfe-commits
huangjd wrote: How do I reopen the PR after fixing the test case? https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-29 Thread William Junda Huang via cfe-commits
https://github.com/huangjd closed https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-28 Thread William Junda Huang via cfe-commits
huangjd wrote: Could I have a follow up on this? @dwblaikie https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-13 Thread William Junda Huang via cfe-commits
@@ -5636,6 +5636,84 @@ void CGDebugInfo::EmitExternalVariable(llvm::GlobalVariable *Var, Var->addDebugInfo(GVE); } +void CGDebugInfo::EmitPseudoVariable(CGBuilderTy &Builder, + llvm::Instruction *Value, QualType Ty) { + // Only when -g2

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-13 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/81545 >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 12 Feb 2024 02:27:13 -0500 Subject: [PATCH 01/13] Add option to generate additional info for expression cont

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-07 Thread William Junda Huang via cfe-commits
https://github.com/huangjd ready_for_review https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-07 Thread William Junda Huang via cfe-commits
https://github.com/huangjd converted_to_draft https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-04-30 Thread William Junda Huang via cfe-commits
@@ -5636,6 +5636,84 @@ void CGDebugInfo::EmitExternalVariable(llvm::GlobalVariable *Var, Var->addDebugInfo(GVE); } +void CGDebugInfo::EmitPseudoVariable(CGBuilderTy &Builder, + llvm::Instruction *Value, QualType Ty) { + // Only when -g2

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-04-30 Thread William Junda Huang via cfe-commits
@@ -5636,6 +5636,84 @@ void CGDebugInfo::EmitExternalVariable(llvm::GlobalVariable *Var, Var->addDebugInfo(GVE); } +void CGDebugInfo::EmitPseudoVariable(CGBuilderTy &Builder, + llvm::Instruction *Value, QualType Ty) { + // Only when -g2

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-04-30 Thread William Junda Huang via cfe-commits
@@ -1787,7 +1787,26 @@ Value *ScalarExprEmitter::VisitMemberExpr(MemberExpr *E) { } } - return EmitLoadOfLValue(E); + llvm::Value *Result = EmitLoadOfLValue(E); + + // If -fdebug_info_for_profiling is specified, emit a pseudo variable and its huangjd

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-04-30 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/81545 >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 12 Feb 2024 02:27:13 -0500 Subject: [PATCH 01/12] Add option to generate additional info for expression cont

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-04-17 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/81545 >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 12 Feb 2024 02:27:13 -0500 Subject: [PATCH 01/11] Add option to generate additional info for expression cont

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-04-01 Thread William Junda Huang via cfe-commits
huangjd wrote: I am making another diff (not to be submitted) to get statistics on how frequently these 2 cases are encountered https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-04-01 Thread William Junda Huang via cfe-commits
huangjd wrote: > > > Reading LLVM IR lit CHECK lines from clang codegen is a bit difficult - > > > could you include some simple examples (perhaps from the new clang tests > > > in this patch) showing the DWARF output just as comments in this review > > > for something more easily glanceable?

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-20 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/81545 >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 12 Feb 2024 02:27:13 -0500 Subject: [PATCH 1/9] Add option to generate additional info for expression contai

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-19 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/81545 >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 12 Feb 2024 02:27:13 -0500 Subject: [PATCH 1/8] Add option to generate additional info for expression contai

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-19 Thread William Junda Huang via cfe-commits
huangjd wrote: > Reading LLVM IR lit CHECK lines from clang codegen is a bit difficult - could > you include some simple examples (perhaps from the new clang tests in this > patch) showing the DWARF output just as comments in this review for something > more easily glanceable? Attached is the

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-18 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/81545 >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 12 Feb 2024 02:27:13 -0500 Subject: [PATCH 1/7] Add option to generate additional info for expression contai

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-18 Thread William Junda Huang via cfe-commits
huangjd wrote: My concern to enable this feature by default is that there are some less known syntax (probably from other supported languages or extensions) that has a MemberExpr but actually emitting something unexpected, which could cause a crash. I am testing this feature on some real-life

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-15 Thread William Junda Huang via cfe-commits
huangjd wrote: So the additional debug info for pointer type should be generated when -fdebug-info-for-profiling is enabled? https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-14 Thread William Junda Huang via cfe-commits
https://github.com/huangjd ready_for_review https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-14 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/81545 >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 12 Feb 2024 02:27:13 -0500 Subject: [PATCH 1/5] Add option to generate additional info for expression contai

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-14 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/81545 >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 12 Feb 2024 02:27:13 -0500 Subject: [PATCH 1/4] Add option to generate additional info for expression contai

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-13 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/81545 >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 12 Feb 2024 02:27:13 -0500 Subject: [PATCH 1/3] Add option to generate additional info for expression contai

[clang] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-03-06 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/81545 >From f2c82758e1cba7773e41d941d2812c829c339675 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 12 Feb 2024 02:27:13 -0500 Subject: [PATCH 1/2] Add option to generate additional info for expression contai

[clang] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-02-12 Thread William Junda Huang via cfe-commits
https://github.com/huangjd created https://github.com/llvm/llvm-project/pull/81545 Such expression does not correspond to a variable in the source code thus does not have a debug location. When the user collects perf data on the program, if the intermediate memory load instruction is sampled,

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

2023-10-09 Thread William Junda Huang 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 William Junda Huang 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 William Junda Huang 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 William Junda Huang 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] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread William Junda Huang 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 William Junda Huang 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-09 Thread William Junda Huang via cfe-commits
@@ -85,7 +86,7 @@ class ProfiledCallGraph { std::queue Queue; for (auto &Child : ContextTracker.getRootContext().getAllChildContext()) { ContextTrieNode *Callee = &Child.second; - addProfiledFunction(ContextTracker.getFuncNameFor(Callee)); + addProfiledF

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

2023-10-09 Thread William Junda Huang 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-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread William Junda Huang 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-09 Thread William Junda Huang 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-10-09 Thread William Junda Huang 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-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread William Junda Huang via cfe-commits
@@ -85,7 +86,7 @@ class ProfiledCallGraph { std::queue Queue; for (auto &Child : ContextTracker.getRootContext().getAllChildContext()) { ContextTrieNode *Callee = &Child.second; - addProfiledFunction(ContextTracker.getFuncNameFor(Callee)); + addProfiledF

[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 William Junda Huang 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-09 Thread William Junda Huang 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-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread William Junda Huang 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-09 Thread William Junda Huang via cfe-commits
@@ -85,7 +86,7 @@ class ProfiledCallGraph { std::queue Queue; for (auto &Child : ContextTracker.getRootContext().getAllChildContext()) { ContextTrieNode *Callee = &Child.second; - addProfiledFunction(ContextTracker.getFuncNameFor(Callee)); + addProfiledF

[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 William Junda Huang 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] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-09 Thread William Junda Huang 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-09 Thread William Junda Huang 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-tools-extra] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

2023-10-05 Thread William Junda Huang via cfe-commits
huangjd wrote: It looks like after using HashKeyMap, the purpose of SymbolMap and GUIDToFuncNameMap can be merged. SymbolMap maps StringRef to Function*, GUIDToFuncNameMap maps ProfileFuncRef's hash code to StringRef, and it's almost exclusively cascaded to SymbolMap lookup, so we can actually

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

2023-10-05 Thread William Junda Huang via cfe-commits
huangjd wrote: It looks like after using HashKeyMap, the purpose of SymbolMap and GUIDToFuncNameMap can be merged. SymbolMap maps StringRef to Function*, GUIDToFuncNameMap maps ProfileFuncRef's hash code to StringRef, and it's almost exclusively cascaded to SymbolMap lookup, so we can actually

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

2023-10-05 Thread William Junda Huang via cfe-commits
huangjd wrote: > > There are two ways ProfileFuncRef can originate (ignoring copy > > constructions): > > ... > > So you are saying there can be hashcode `ProfileFuncRef`s coming from the > profile, but an `llvm::Function` would always produce a string > `ProfileFuncRef`? > > > B - Whenever

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

2023-10-04 Thread William Junda Huang via cfe-commits
huangjd wrote: To clarify the implementation of ProfileFuncRef and how it guarantees correctness. There are two ways ProfileFuncRef can originate (ignoring copy constructions): 1 - From reading the profile, in which all ProfileFuncRef should have the same representation (either StringRef or M

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

2023-10-04 Thread William Junda Huang via cfe-commits
huangjd wrote: To clarify the implementation of ProfileFuncRef and how it guarantees correctness. There are two ways ProfileFuncRef can originate (ignoring copy constructions): 1 - From reading the profile, in which all ProfileFuncRef should have the same representation (either StringRef or M

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

2023-09-21 Thread William Junda Huang via cfe-commits
huangjd wrote: Full profile load is further reduced to 24s after optimizing lazy loading of name table, which was a bottleneck https://github.com/llvm/llvm-project/pull/66164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

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

2023-09-21 Thread William Junda Huang via cfe-commits
huangjd wrote: I will hold on renaming variables to a different patch because this will change files everywhere, may cause confusion to review in this patch. https://github.com/llvm/llvm-project/pull/66164 ___ cfe-commits mailing list cfe-commits@lis

[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 William Junda Huang 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 William Junda Huang via cfe-commits
huangjd wrote: Added performance measurement. This patch does significantly reduce profile load time, which is its motivation https://github.com/llvm/llvm-project/pull/66164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

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

2023-09-20 Thread William Junda Huang via cfe-commits
huangjd wrote: Added performance measurement. This patch does significantly reduce profile load time, which is its motivation https://github.com/llvm/llvm-project/pull/66164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[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 William Junda Huang via cfe-commits
https://github.com/huangjd edited 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

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

2023-09-20 Thread William Junda Huang via cfe-commits
https://github.com/huangjd edited 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

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

2023-09-20 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/66164 >From dcaa197c8b4e80fba83fc3905b0488a44fe89cc5 Mon Sep 17 00:00:00 2001 From: William Huang Date: Fri, 15 Sep 2023 23:08:46 + Subject: [PATCH 1/2] Rebase with main --- .../include/llvm/ProfileData/ProfileFu

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

2023-09-20 Thread William Junda Huang via cfe-commits
https://github.com/huangjd updated https://github.com/llvm/llvm-project/pull/66164 >From dcaa197c8b4e80fba83fc3905b0488a44fe89cc5 Mon Sep 17 00:00:00 2001 From: William Huang Date: Fri, 15 Sep 2023 23:08:46 + Subject: [PATCH] Rebase with main --- .../include/llvm/ProfileData/ProfileFuncRe