[PATCH] D84569: [ELF] --reproduce should include lto sample profile

Christy Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 18:30:11 PDT 2020


christylee updated this revision to Diff 280645.
christylee added a comment.
Herald added subscribers: steven_wu, hiraditya.

Moved test case to reproduce-lto.s


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84569

Files:
  lld/ELF/Driver.cpp
  lld/test/ELF/reproduce-lto.s


Index: lld/test/ELF/reproduce-lto.s
===================================================================
--- /dev/null
+++ lld/test/ELF/reproduce-lto.s
@@ -0,0 +1,10 @@
+# REQUIRES: x86
+
+# RUN: rm -rf %t.dir
+# RUN: mkdir -p %t.dir/build1
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.dir/build1/foo.o
+# RUN: echo "# empty lto sample profile" > %t.dir/build1/empty_profile.txt
+# RUN: cd %t.dir
+# RUN: ld.lld --hash-style=gnu build1/foo.o -o bar --reproduce repro1.tar --lto-sample-profile=%t.dir/build1/empty_profile.txt
+# RUN: tar tvf repro1.tar | FileCheck %s
+# CHECK: repro1/{{.*}}/empty_profile.txt
Index: lld/ELF/Driver.cpp
===================================================================
--- lld/ELF/Driver.cpp
+++ lld/ELF/Driver.cpp
@@ -495,6 +495,9 @@
       tar = std::move(*errOrWriter);
       tar->append("response.txt", createResponseFile(args));
       tar->append("version.txt", getLLDVersion() + "\n");
+      StringRef ltoSampleProfile = args.getLastArgValue(OPT_lto_sample_profile);
+      if (!ltoSampleProfile.empty())
+        readFile(ltoSampleProfile);
     } else {
       error("--reproduce: " + toString(errOrWriter.takeError()));
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84569.280645.patch
Type: text/x-patch
Size: 1195 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200725/b7a6f2c1/attachment.bin>


More information about the llvm-commits mailing list