[PATCH] D56675: [lld] add options for context-sensitive PGO.

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 11:46:17 PST 2019


xur marked an inline comment as done.
xur added inline comments.


================
Comment at: ELF/Options.td:472-475
+def: F<"plugin-opt=cs-profile-generate">,
+  Alias<lto_cs_pgo_gen>, HelpText<"Alias for -lto-cs-pgo-gen">;
+def: J<"plugin-opt=cs-profile-path=">,
+  Alias<lto_cs_profile_file>, HelpText<"Alias for -lto-cs-profile-file">;
----------------
xur wrote:
> ruiu wrote:
> > Actually, do you have to add these options? `-plugin-opt=foo` is an option for backward compatibility with gold. Since lld has a native LTO support, "plugin opt" doesn't make sense anymore. If they are new options, you shouldn't add `-plugin-opt` aliases.
> Sorry I missed this comment.
> 
> I actually do use -plugin-opt options. If I remove these two options, I got errors in my test.
> ld.lld: error: --plugin-opt: ld.lld: Unknown command line argument 'cs-profile-generate'.
> 
> The command line options  are " ..  -fcs-profile-generate=pass2 -flto=thin -fuse-ld=lld".
CSPGO options are handled in tools::AddGoldPlugin() (in lib/Driver/ToolChains/CommonArgs.cpp) for LTO/ThinLTO, and we add -plugin-opt there.
tools::AddGoldPlugin() is called regardless of what linker is used. 
So I think lld needs to handle these -plugin-ops.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56675/new/

https://reviews.llvm.org/D56675





More information about the llvm-commits mailing list