[profile] runtime counter relocation needed on all windows targets (#127858)

See PR comments for the discussion that led to this commit.
This commit is contained in:
Wael Yehia
2025-03-12 02:50:54 +00:00
parent ab22f652a4
commit 9ef7287d42
2 changed files with 2 additions and 2 deletions

View File

@@ -762,8 +762,7 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C,
else {
CmdArgs.push_back("-fprofile-continuous");
// Platforms that require a bias variable:
if (T.isOSBinFormatELF() || T.isOSAIX() ||
T.isKnownWindowsMSVCEnvironment()) {
if (T.isOSBinFormatELF() || T.isOSAIX() || T.isOSWindows()) {
CmdArgs.push_back("-mllvm");
CmdArgs.push_back("-runtime-counter-relocation");
}

View File

@@ -7,6 +7,7 @@
// RUN: %clang --target=powerpc64-ibm-aix -fprofile-generate -fprofile-continuous -### -c %s 2>&1 | FileCheck %s --check-prefix=RELOC
// RUN: %clang --target=x86_64-unknown-fuchsia -fprofile-generate -fprofile-continuous -### -c %s 2>&1 | FileCheck %s --check-prefix=RELOC
// RUN: %clang --target=x86_64-windows-msvc -fprofile-generate -fprofile-continuous -### -c %s 2>&1 | FileCheck %s --check-prefix=RELOC
// RUN: %clang --target=x86_64-windows-gnu -fprofile-generate -fprofile-continuous -### -c %s 2>&1 | FileCheck %s --check-prefix=RELOC
// RELOC: "-cc1" {{.*}} "-fprofile-continuous" "-mllvm" "-runtime-counter-relocation"
// 2) test -fprofile-continuous with cs-profile-generate and -fprofile-instr-generate