[PATCH] D124105: [ELF] Support -plugin-opt=statsfile=
Alexander Richardson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 27 03:07:08 PDT 2022
arichardson updated this revision to Diff 425459.
arichardson added a comment.
Replace --stats-file and make the test actually run
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124105/new/
https://reviews.llvm.org/D124105
Files:
lld/ELF/Driver.cpp
lld/ELF/Options.td
lld/test/ELF/lto/stats-file-option.ll
lld/test/lit.cfg.py
Index: lld/test/lit.cfg.py
===================================================================
--- lld/test/lit.cfg.py
+++ lld/test/lit.cfg.py
@@ -74,7 +74,8 @@
'RISCV': 'riscv',
'Sparc': 'sparc',
'WebAssembly': 'wasm',
- 'X86': 'x86'})
+ 'X86': 'x86'}),
+ ('--assertion-mode', {'ON': 'asserts'}),
])
# Set a fake constant version so that we get consistent output.
Index: lld/test/ELF/lto/stats-file-option.ll
===================================================================
--- lld/test/ELF/lto/stats-file-option.ll
+++ lld/test/ELF/lto/stats-file-option.ll
@@ -3,7 +3,7 @@
; RUN: llvm-as -o %t.bc %s
;; Try to save statistics to file.
-; RUN: ld.lld --stats-file=%t2.stats -m elf_x86_64 -r -o %t.o %t.bc
+; RUN: ld.lld --plugin-opt=stats-file=%t2.stats -m elf_x86_64 -r -o %t.o %t.bc
; RUN: FileCheck --input-file=%t2.stats %s
; CHECK: {
Index: lld/ELF/Options.td
===================================================================
--- lld/ELF/Options.td
+++ lld/ELF/Options.td
@@ -582,8 +582,6 @@
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)">;
-def opt_stats_filename: JJ<"stats-file=">,
- HelpText<"Filename to write statistics to">;
def save_temps: F<"save-temps">, HelpText<"Save intermediate LTO compilation results">;
def lto_basic_block_sections: JJ<"lto-basic-block-sections=">,
HelpText<"Enable basic block sections for LTO">;
@@ -646,6 +644,8 @@
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">;
+def plugin_opt_stats_file: J<"plugin-opt=stats-file=">,
+ HelpText<"Filename to write LTO statistics to">;
def: F<"plugin-opt=thinlto-emit-imports-files">,
Alias<thinlto_emit_imports_files>,
HelpText<"Alias for --thinlto-emit-imports-files">;
Index: lld/ELF/Driver.cpp
===================================================================
--- lld/ELF/Driver.cpp
+++ lld/ELF/Driver.cpp
@@ -1127,7 +1127,7 @@
config->oFormatBinary = isOutputFormatBinary(args);
config->omagic = args.hasFlag(OPT_omagic, OPT_no_omagic, false);
config->optRemarksFilename = args.getLastArgValue(OPT_opt_remarks_filename);
- config->optStatsFilename = args.getLastArgValue(OPT_opt_stats_filename);
+ config->optStatsFilename = args.getLastArgValue(OPT_plugin_opt_stats_file);
// Parse remarks hotness threshold. Valid value is either integer or 'auto'.
if (auto *arg = args.getLastArg(OPT_opt_remarks_hotness_threshold)) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124105.425459.patch
Type: text/x-patch
Size: 2815 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220427/62ab7c56/attachment.bin>
More information about the llvm-commits
mailing list