[profile] Add a clang option -fprofile-continuous that enables continuous instrumentation profiling mode by w2yehia · Pull Request #124353 · llvm/llvm-project (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

w2yehia

@llvmbot llvmbot added clang

Clang issues not falling into any other category

clang:driver

'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

clang:frontend

Language frontend issues, e.g. anything involving "Sema"

clang:codegen

IR generation bugs: mangling, exceptions, etc.

labels

Jan 24, 2025

david-xl

carlocab

MaskRay

MaskRay

MaskRay

shafik

MaskRay

Wael Yehia added 2 commits

January 30, 2025 17:12

@w2yehia w2yehia changed the title[PGO] Add a clang option -fprofile-continuous that enables PGO continuous mode [PGO] Add a clang option -fprofile-continuous that enables continuous instrumentation profiling mode

Feb 6, 2025

MaskRay

MaskRay

@w2yehia w2yehia changed the title[PGO] Add a clang option -fprofile-continuous that enables continuous instrumentation profiling mode [profile] Add a clang option -fprofile-continuous that enables continuous instrumentation profiling mode

Feb 6, 2025

hubert-reinterpretcast

Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request

Feb 11, 2025

@w2yehia @Icohedron

w2yehia added a commit that referenced this pull request

Mar 15, 2025

@w2yehia

PR #124353 introduced the clang option -fprofile-continuous to enable continuous mode. Use this option in all compiler-rt tests, where applicable.

Changes can be summarized as follows:

  1. tests that use -fprofile-instr-generate (%clang_profgen), which is an option that takes profile file name, are changed like so:
-// RUN: %clang_profgen_cont <SOME-OPTIONS> -o %t.exe %s
-// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe
+// RUN: %clang_profgen=%t.profraw -fprofile-continuous <SOME-OPTIONS> -o %t.exe %s
+// RUN: %run %t.exe
  1. tests that use -fprofile-generate (%clang_pgogen), which is an option that takes a profile directory, are on case-by-case basis. Where the default name "default_%m.profraw" works, those tests were changed to use %clang_pgogen=<dir>, and the rest (set-filename.c and get-filename.c) continued to use the LLVM_PROFILE_FILE environment variable .
  2. set-file-object.c uses different filename for different run of the same executable, so it continued to use the LLVM_PROFILE_FILE environment variable.
  3. pid-substitution.c add a clang_profgen variation.

Co-authored-by: Wael Yehia wyehia@ca.ibm.com