[lld] r363573 - [Remarks] Extend -fsave-optimization-record to specify the format
Francis Visoiu Mistrih via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 17 09:06:00 PDT 2019
Author: thegameg
Date: Mon Jun 17 09:06:00 2019
New Revision: 363573
URL: http://llvm.org/viewvc/llvm-project?rev=363573&view=rev
Log:
[Remarks] Extend -fsave-optimization-record to specify the format
Use -fsave-optimization-record=<format> to specify a different format
than the default, which is YAML.
For now, only YAML is supported.
Modified:
lld/trunk/ELF/Config.h
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/LTO.cpp
lld/trunk/ELF/Options.td
lld/trunk/test/ELF/lto/opt-remarks.ll
Modified: lld/trunk/ELF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Config.h?rev=363573&r1=363572&r2=363573&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Mon Jun 17 09:06:00 2019
@@ -100,6 +100,7 @@ struct Configuration {
llvm::StringRef OutputFile;
llvm::StringRef OptRemarksFilename;
llvm::StringRef OptRemarksPasses;
+ llvm::StringRef OptRemarksFormat;
llvm::StringRef ProgName;
llvm::StringRef PrintSymbolOrder;
llvm::StringRef SoName;
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=363573&r1=363572&r2=363573&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Mon Jun 17 09:06:00 2019
@@ -857,6 +857,7 @@ static void readConfigs(opt::InputArgLis
Config->OptRemarksFilename = Args.getLastArgValue(OPT_opt_remarks_filename);
Config->OptRemarksPasses = Args.getLastArgValue(OPT_opt_remarks_passes);
Config->OptRemarksWithHotness = Args.hasArg(OPT_opt_remarks_with_hotness);
+ Config->OptRemarksFormat = Args.getLastArgValue(OPT_opt_remarks_format);
Config->Optimize = args::getInteger(Args, OPT_O, 1);
Config->OrphanHandling = getOrphanHandling(Args);
Config->OutputFile = Args.getLastArgValue(OPT_o);
Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=363573&r1=363572&r2=363573&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Mon Jun 17 09:06:00 2019
@@ -99,6 +99,7 @@ static lto::Config createConfig() {
C.RemarksFilename = Config->OptRemarksFilename;
C.RemarksPasses = Config->OptRemarksPasses;
C.RemarksWithHotness = Config->OptRemarksWithHotness;
+ C.RemarksFormat = Config->OptRemarksFormat;
C.SampleProfile = Config->LTOSampleProfile;
C.UseNewPM = Config->LTONewPassManager;
Modified: lld/trunk/ELF/Options.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=363573&r1=363572&r2=363573&view=diff
==============================================================================
--- lld/trunk/ELF/Options.td (original)
+++ lld/trunk/ELF/Options.td Mon Jun 17 09:06:00 2019
@@ -485,6 +485,8 @@ def opt_remarks_passes: Separate<["--"],
HelpText<"Regex for the passes that need to be serialized to the output file">;
def opt_remarks_with_hotness: Flag<["--"], "opt-remarks-with-hotness">,
HelpText<"Include hotness information in the optimization remarks file">;
+def opt_remarks_format: Separate<["--"], "opt-remarks-format">,
+ HelpText<"The format used for serializing remarks (default: YAML)">;
defm plugin_opt: Eq<"plugin-opt", "specifies LTO options for compatibility with GNU linkers">;
def save_temps: F<"save-temps">;
def thinlto_cache_dir: J<"thinlto-cache-dir=">,
Modified: lld/trunk/test/ELF/lto/opt-remarks.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/opt-remarks.ll?rev=363573&r1=363572&r2=363573&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/opt-remarks.ll (original)
+++ lld/trunk/test/ELF/lto/opt-remarks.ll Mon Jun 17 09:06:00 2019
@@ -11,6 +11,9 @@
; RUN: ld.lld --opt-remarks-filename %t1.yaml --opt-remarks-passes inline %t.o \
; RUN: -o /dev/null -shared
; RUN: cat %t1.yaml | FileCheck %s -check-prefix=YAML-PASSES
+; RUN: ld.lld --opt-remarks-filename %t1.yaml --opt-remarks-format yaml %t.o \
+; RUN: -o /dev/null -shared
+; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML
; Check that @tinkywinky is inlined after optimizations.
; CHECK-LABEL: define i32 @main
More information about the llvm-commits
mailing list