[PATCH] D110671: [AIX] Enable PGO without LTO
Jinsong Ji via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 28 19:00:33 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1e48951c736c: [AIX] Enable PGO without LTO (authored by jsji).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110671/new/
https://reviews.llvm.org/D110671
Files:
clang/lib/Driver/ToolChains/AIX.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/unsupported-option.c
Index: clang/test/Driver/unsupported-option.c
===================================================================
--- clang/test/Driver/unsupported-option.c
+++ clang/test/Driver/unsupported-option.c
@@ -14,14 +14,6 @@
// RUN: FileCheck %s --check-prefix=AIX-PROFILE-SAMPLE
// AIX-PROFILE-SAMPLE: error: unsupported option '-fprofile-sample-use=' for target
-// RUN: not %clang -fprofile-generate --target=powerpc-ibm-aix %s 2>&1 | \
-// RUN: FileCheck %s --check-prefix=AIX-PROFILE-LTO
-// AIX-PROFILE-LTO: error: invalid argument '-fprofile-generate' only allowed with '-flto'
-
-// RUN: not %clang -fprofile-generate -flto=thin --target=powerpc64-ibm-aix %s 2>&1 | \
-// RUN: FileCheck %s --check-prefix=AIX-PROFILE-THINLTO
-// AIX-PROFILE-THINLTO: error: invalid argument '-fprofile-generate' only allowed with '-flto'
-
// RUN: not %clang --target=powerpc-ibm-aix %s -mlong-double-128 2>&1 | \
// RUN: FileCheck %s --check-prefix=AIX-LONGDOUBLE128-ERR
// AIX-LONGDOUBLE128-ERR: error: unsupported option '-mlong-double-128' for target 'powerpc-ibm-aix'
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -795,11 +795,6 @@
}
if (TC.getTriple().isOSAIX()) {
- if (PGOGenerateArg)
- if (!D.isUsingLTO(false /*IsDeviceOffloadAction */) ||
- D.getLTOMode() != LTOK_Full)
- D.Diag(clang::diag::err_drv_argument_only_allowed_with)
- << PGOGenerateArg->getSpelling() << "-flto";
if (ProfileGenerateArg)
D.Diag(diag::err_drv_unsupported_opt_for_target)
<< ProfileGenerateArg->getSpelling() << TC.getTriple().str();
Index: clang/lib/Driver/ToolChains/AIX.cpp
===================================================================
--- clang/lib/Driver/ToolChains/AIX.cpp
+++ clang/lib/Driver/ToolChains/AIX.cpp
@@ -98,6 +98,25 @@
CmdArgs.push_back("-bnoentry");
}
+ // Specify PGO linker option
+ if ((Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs,
+ false) ||
+ Args.hasFlag(options::OPT_fprofile_generate,
+ options::OPT_fno_profile_generate, false) ||
+ Args.hasFlag(options::OPT_fprofile_generate_EQ,
+ options::OPT_fno_profile_generate, false) ||
+ Args.hasFlag(options::OPT_fprofile_instr_generate,
+ options::OPT_fno_profile_instr_generate, false) ||
+ Args.hasFlag(options::OPT_fprofile_instr_generate_EQ,
+ options::OPT_fno_profile_instr_generate, false) ||
+ Args.hasFlag(options::OPT_fcs_profile_generate,
+ options::OPT_fno_profile_generate, false) ||
+ Args.hasFlag(options::OPT_fcs_profile_generate_EQ,
+ options::OPT_fno_profile_generate, false) ||
+ Args.hasArg(options::OPT_fcreate_profile) ||
+ Args.hasArg(options::OPT_coverage)))
+ CmdArgs.push_back("-bdbg:namedcsects");
+
// Specify linker output file.
assert((Output.isFilename() || Output.isNothing()) && "Invalid output.");
if (Output.isFilename()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110671.375763.patch
Type: text/x-patch
Size: 3169 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210929/8f87197a/attachment-0001.bin>
More information about the cfe-commits
mailing list