[PATCH] D56675: [lld] add options for context-sensitive PGO.
Rong Xu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 15:53:35 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL355876: [PGO] Add options for context-sensitive PGO (authored by xur, committed by ).
Herald added a project: LLVM.
Changed prior to commit:
https://reviews.llvm.org/D56675?vs=190169&id=190171#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56675/new/
https://reviews.llvm.org/D56675
Files:
lld/trunk/ELF/Config.h
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/LTO.cpp
lld/trunk/ELF/Options.td
Index: lld/trunk/ELF/Config.h
===================================================================
--- lld/trunk/ELF/Config.h
+++ lld/trunk/ELF/Config.h
@@ -92,6 +92,7 @@
llvm::StringRef Fini;
llvm::StringRef Init;
llvm::StringRef LTOAAPipeline;
+ llvm::StringRef LTOCSProfileFile;
llvm::StringRef LTONewPmPasses;
llvm::StringRef LTOObjPath;
llvm::StringRef LTOSampleProfile;
@@ -151,6 +152,7 @@
bool HasDynSymTab;
bool IgnoreDataAddressEquality;
bool IgnoreFunctionAddressEquality;
+ bool LTOCSProfileGenerate;
bool LTODebugPassManager;
bool LTONewPassManager;
bool MergeArmExidx;
Index: lld/trunk/ELF/LTO.cpp
===================================================================
--- lld/trunk/ELF/LTO.cpp
+++ lld/trunk/ELF/LTO.cpp
@@ -104,6 +104,9 @@
C.DebugPassManager = Config->LTODebugPassManager;
C.DwoDir = Config->DwoDir;
+ C.CSIRProfile = Config->LTOCSProfileFile;
+ C.RunCSIRInstr = Config->LTOCSProfileGenerate;
+
if (Config->EmitLLVM) {
C.PostInternalizeModuleHook = [](size_t Task, const Module &M) {
if (std::unique_ptr<raw_fd_ostream> OS = openFile(Config->OutputFile))
Index: lld/trunk/ELF/Driver.cpp
===================================================================
--- lld/trunk/ELF/Driver.cpp
+++ lld/trunk/ELF/Driver.cpp
@@ -800,6 +800,8 @@
Args.hasArg(OPT_ignore_function_address_equality);
Config->Init = Args.getLastArgValue(OPT_init, "_init");
Config->LTOAAPipeline = Args.getLastArgValue(OPT_lto_aa_pipeline);
+ Config->LTOCSProfileGenerate = Args.hasArg(OPT_lto_cs_profile_generate);
+ Config->LTOCSProfileFile = Args.getLastArgValue(OPT_lto_cs_profile_file);
Config->LTODebugPassManager = Args.hasArg(OPT_lto_debug_pass_manager);
Config->LTONewPassManager = Args.hasArg(OPT_lto_new_pass_manager);
Config->LTONewPmPasses = Args.getLastArgValue(OPT_lto_newpm_passes);
Index: lld/trunk/ELF/Options.td
===================================================================
--- lld/trunk/ELF/Options.td
+++ lld/trunk/ELF/Options.td
@@ -444,6 +444,10 @@
HelpText<"Optimization level for LTO">;
def lto_partitions: J<"lto-partitions=">,
HelpText<"Number of LTO codegen partitions">;
+def lto_cs_profile_generate: F<"lto-cs-profile-generate">,
+ HelpText<"Perform context senstive PGO instrumentation">;
+def lto_cs_profile_file: J<"lto-cs-profile-file=">,
+ HelpText<"Context sensitive profile file path">;
def lto_sample_profile: J<"lto-sample-profile=">,
HelpText<"Sample profile file path">;
def disable_verify: F<"disable-verify">;
@@ -472,6 +476,10 @@
def: F<"plugin-opt=new-pass-manager">,
Alias<lto_new_pass_manager>, HelpText<"Alias for -lto-new-pass-manager">;
def plugin_opt_obj_path_eq: J<"plugin-opt=obj-path=">;
+def: F<"plugin-opt=cs-profile-generate">,
+ Alias<lto_cs_profile_generate>, HelpText<"Alias for -lto-cs-profile-generate">;
+def: J<"plugin-opt=cs-profile-path=">,
+ Alias<lto_cs_profile_file>, HelpText<"Alias for -lto-cs-profile-file">;
def: J<"plugin-opt=sample-profile=">,
Alias<lto_sample_profile>, HelpText<"Alias for -lto-sample-profile">;
def: F<"plugin-opt=save-temps">, Alias<save_temps>, HelpText<"Alias for -save-temps">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56675.190171.patch
Type: text/x-patch
Size: 3188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190311/92382b86/attachment-0001.bin>
More information about the llvm-commits
mailing list