This is an archive of the discontinued LLVM Phabricator instance.

[LTO] Change addSaveTemps API: do not add dot to the supplied prefix path
ClosedPublic

Authored by mehdi_amini on Aug 17 2016, 9:54 AM.

Details

Summary

It does not play well with directories (end up with a bunch of hidden
files).
Also, do not strip the 0 suffix for the first task, especially since
0 can be used by ThinLTO as well now.

Diff Detail

Repository
rL LLVM

Event Timeline

mehdi_amini retitled this revision from to [LTO] Change addSaveTemps API: do not add dot to the supplied prefix path.
mehdi_amini updated this object.
mehdi_amini added a reviewer: tejohnson.
mehdi_amini added subscribers: llvm-commits, pcc.
tejohnson added inline comments.Aug 17 2016, 2:41 PM
lib/LTO/LTOBackend.cpp
64 ↗(On Diff #68375)

With this change we won't get the "." between the module ID and the suffix in the case when we have set UseInputModulePath to true. I suspect that will cause gold tests to fail (and is less pretty overall).

Instead, can the new addition of "." after the Task Id on line 61 be removed?

Fix the "." for the UseInputModulePath case

mehdi_amini marked an inline comment as done.Aug 17 2016, 3:44 PM
mehdi_amini added inline comments.
lib/LTO/LTOBackend.cpp
64 ↗(On Diff #68440)

Done!

tejohnson accepted this revision.Aug 17 2016, 4:41 PM
tejohnson edited edge metadata.

LGTM with two fixes. One compile failure in gold-plugin.cc noted below, and one test needs the following fix:

diff --git a/test/tools/gold/X86/opt-level.ll b/test/tools/gold/X86/opt-level.ll
index a680a16..66935b4 100644

  • a/test/tools/gold/X86/opt-level.ll

+++ b/test/tools/gold/X86/opt-level.ll
@@ -1,13 +1,13 @@
; RUN: llvm-as -o %t.bc %s
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \
; RUN: -plugin-opt=O0 -r -o %t.o %t.bc
-; RUN: llvm-dis < %t.o.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s
+; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \
; RUN: -plugin-opt=O1 -r -o %t.o %t.bc
-; RUN: llvm-dis < %t.o.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 %s
+; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 %s
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \
; RUN: -plugin-opt=O2 -r -o %t.o %t.bc
-; RUN: llvm-dis < %t.o.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s
+; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s

; CHECK-O0: define internal void @foo(
; CHECK-O1: define internal void @foo(

tools/gold/gold-plugin.cpp
799 ↗(On Diff #68440)

Won't build until Twine removed.

This revision is now accepted and ready to land.Aug 17 2016, 4:41 PM
This revision was automatically updated to reflect the committed changes.
mehdi_amini marked an inline comment as done.