[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2024-01-09 Thread Mingming Liu via cfe-commits
minglotus-6 wrote: > > Breaks https://lab.llvm.org/buildbot/#/builders/127/builds/60635 Please fix > > or revert. > > Thanks for reporting the problem @vitalybuka ! > > I don't have a Windows machine to reproduce the issue. It is not clear to me > how the IR can contain names like >

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2024-01-09 Thread Qiongsi Wu via cfe-commits
qiongsiwu wrote: > Breaks https://lab.llvm.org/buildbot/#/builders/127/builds/60635 Please fix > or revert. Thanks for reporting the problem @vitalybuka ! I don't have a Windows machine to reproduce the issue. It is not clear to me how the IR can contain names like

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2024-01-03 Thread Qiongsi Wu via cfe-commits
qiongsiwu wrote: I realized one problem during testing IRPGO (thanks again for the suggestion @minglotus-6 !). A functions control flow may change between `-fprofile-generate` and `-fprofile-use` when we make use of definitions in the new header. For example, one may have the following

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2024-01-03 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu updated https://github.com/llvm/llvm-project/pull/76471 >From 6c9381ec324595947237bd25642b03ab40b6a4df Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Wed, 27 Dec 2023 13:05:01 -0500 Subject: [PATCH 01/13] Initial commit ---

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2024-01-02 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu updated https://github.com/llvm/llvm-project/pull/76471 >From 6c9381ec324595947237bd25642b03ab40b6a4df Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Wed, 27 Dec 2023 13:05:01 -0500 Subject: [PATCH 01/12] Initial commit ---

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2024-01-02 Thread Mingming Liu via cfe-commits
https://github.com/minglotus-6 edited https://github.com/llvm/llvm-project/pull/76471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2024-01-02 Thread Mingming Liu via cfe-commits
@@ -0,0 +1,16 @@ +// Test the linker feature that treats undefined weak symbols as null values. + +// RUN: %clang_pgogen -o %t %s minglotus-6 wrote: Please discard this comment. @snehasish pointed out build-bots doesn't really have coverage of AIX linker, and

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2024-01-02 Thread Mingming Liu via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_profgen %s --target=ppc64le-unknown-linux-gnu -S \ +// RUN:-emit-llvm -o - | FileCheck %s --check-prefix=PROFGEN +// RUN: %clang_profgen -o %t %s +// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t minglotus-6 wrote: > I don't

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2024-01-02 Thread Mingming Liu via cfe-commits
@@ -0,0 +1,16 @@ +// Test the linker feature that treats undefined weak symbols as null values. + +// RUN: %clang_pgogen -o %t %s minglotus-6 wrote: This just occurred to me, if the tested feature relies on linker implementation, does it need `REQUIRES: ` so

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2024-01-02 Thread Mingming Liu via cfe-commits
https://github.com/minglotus-6 approved this pull request. thanks! Mostly lg with a pending discussion on whether we want to have test coverage for `clang_pgogen` in `compiler-rt/test/profile/instrprof-api.c`, and the open-ended discussion about the observed build failure in another

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2023-12-28 Thread Qiongsi Wu via cfe-commits
@@ -1364,12 +1364,22 @@ static void InitializePredefinedMacros(const TargetInfo , TI.getTargetDefines(LangOpts, Builder); } +static void InitializePGOProfileMacros(const CodeGenOptions , + MacroBuilder ) { + if

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2023-12-28 Thread Qiongsi Wu via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_profgen %s -S -emit-llvm -o - | FileCheck %s --check-prefix=PROFGEN +// RUN: %clang_profgen -o %t %s +// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t +// RUN: llvm-profdata merge -o %t.profdata %t.profraw +// RUN: %clang_profuse=%t.profdata %s

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2023-12-28 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu edited https://github.com/llvm/llvm-project/pull/76471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2023-12-28 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu updated https://github.com/llvm/llvm-project/pull/76471 >From 6c9381ec324595947237bd25642b03ab40b6a4df Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Wed, 27 Dec 2023 13:05:01 -0500 Subject: [PATCH 1/7] Initial commit --- .../ExpandModularHeadersPPCallbacks.cpp

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2023-12-27 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu commented: Thanks so much @snehasish for the fast review! I have two questions regarding your comments. I will address the remaining comments soon as well! https://github.com/llvm/llvm-project/pull/76471 ___ cfe-commits

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2023-12-27 Thread Qiongsi Wu via cfe-commits
qiongsiwu wrote: Note to reviewers: I am only adding these three PGO functions because I am not sure if more should be added. Please let me know, and I will revise the PR. https://github.com/llvm/llvm-project/pull/76471 ___ cfe-commits mailing list

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2023-12-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qiongsi Wu (qiongsiwu) Changes This PR exposes three PGO functions `__llvm_profile_reset_counters`, `__llvm_profile_dump` and `__llvm_orderfile_dump` to user programs through the new header `instr_prof_interface.h` under

[clang] [compiler-rt] [clang-tools-extra] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

2023-12-27 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu created https://github.com/llvm/llvm-project/pull/76471 This PR exposes three PGO functions `__llvm_profile_reset_counters`, `__llvm_profile_dump` and `__llvm_orderfile_dump` to user programs through the new header `instr_prof_interface.h` under