[lld] r267230 - LTO: Merge -lto-no-discard-value-names with -save-temps.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 22 14:43:10 PDT 2016
Author: ruiu
Date: Fri Apr 22 16:43:10 2016
New Revision: 267230
URL: http://llvm.org/viewvc/llvm-project?rev=267230&view=rev
Log:
LTO: Merge -lto-no-discard-value-names with -save-temps.
This patch is to remove -lto-no-discard-value-names flag and
instead to use -save-temps as we discussed in the post-commit
review thread for r267020.
Differential Revision: http://reviews.llvm.org/D19437
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/discard-value-names.ll
lld/trunk/test/ELF/lto/type-merge2.ll
Modified: lld/trunk/ELF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Config.h?rev=267230&r1=267229&r2=267230&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Fri Apr 22 16:43:10 2016
@@ -59,7 +59,6 @@ struct Configuration {
bool Demangle = true;
bool DisableVerify;
bool DiscardAll;
- bool DiscardValueNames;
bool DiscardLocals;
bool DiscardNone;
bool EhFrameHdr;
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=267230&r1=267229&r2=267230&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Fri Apr 22 16:43:10 2016
@@ -284,7 +284,6 @@ void LinkerDriver::readConfigs(opt::Inpu
Config->Demangle = !Args.hasArg(OPT_no_demangle);
Config->DisableVerify = Args.hasArg(OPT_disable_verify);
Config->DiscardAll = Args.hasArg(OPT_discard_all);
- Config->DiscardValueNames = !Args.hasArg(OPT_lto_no_discard_value_names);
Config->DiscardLocals = Args.hasArg(OPT_discard_locals);
Config->DiscardNone = Args.hasArg(OPT_discard_none);
Config->EhFrameHdr = Args.hasArg(OPT_eh_frame_hdr);
Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=267230&r1=267229&r2=267230&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Fri Apr 22 16:43:10 2016
@@ -87,7 +87,11 @@ static bool shouldInternalize(const Smal
BitcodeCompiler::BitcodeCompiler()
: Combined(new llvm::Module("ld-temp.o", Context)), Mover(*Combined) {
- Context.setDiscardValueNames(Config->DiscardValueNames);
+ // This is a flag to discard all but GlobalValue names.
+ // We want to enable it by default because it saves memory.
+ // Disable it only when a developer option (-save-temps) is given.
+ Context.setDiscardValueNames(!Config->SaveTemps);
+
Context.enableDebugTypeODRUniquing();
}
Modified: lld/trunk/ELF/Options.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=267230&r1=267229&r2=267230&view=diff
==============================================================================
--- lld/trunk/ELF/Options.td (original)
+++ lld/trunk/ELF/Options.td Fri Apr 22 16:43:10 2016
@@ -245,7 +245,6 @@ def G : Separate<["-"], "G">;
def alias_version_script_version_script : Joined<["--"], "version-script=">, Alias<version_script>;
// LTO-related options.
-def lto_no_discard_value_names : Flag<["-"], "lto-no-discard-value-names">;
def lto_jobs : Joined<["--"], "lto-jobs=">,
HelpText<"Number of threads to run codegen">;
def disable_verify : Flag<["-"], "disable-verify">;
Modified: lld/trunk/test/ELF/lto/discard-value-names.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/discard-value-names.ll?rev=267230&r1=267229&r2=267230&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/discard-value-names.ll (original)
+++ lld/trunk/test/ELF/lto/discard-value-names.ll Fri Apr 22 16:43:10 2016
@@ -1,10 +1,7 @@
; RUN: llvm-as %s -o %t.o
-; RUN: ld.lld -m elf_x86_64 -lto-no-discard-value-names -shared -save-temps %t.o -o %t2.o
-; RUN: llvm-dis < %t2.o.lto.bc | FileCheck %s
-
; RUN: ld.lld -m elf_x86_64 -shared -save-temps %t.o -o %t2.o
-; RUN: llvm-dis < %t2.o.lto.bc | FileCheck --check-prefix=NONAME %s
+; RUN: llvm-dis < %t2.o.lto.bc | FileCheck %s
; CHECK: @GlobalValueName
; CHECK: @foo(i32 %in)
@@ -13,13 +10,6 @@
; CHECK: %add = add i32 %in, %GV
; CHECK: ret i32 %add
-; NONAME: @GlobalValueName
-; NONAME: @foo(i32)
-; NONAME-NOT: somelabel:
-; NONAME: %2 = load i32, i32* @GlobalValueName
-; NONAME: %3 = add i32 %0, %2
-; NONAME: ret i32 %3
-
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Modified: lld/trunk/test/ELF/lto/type-merge2.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/type-merge2.ll?rev=267230&r1=267229&r2=267230&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/type-merge2.ll (original)
+++ lld/trunk/test/ELF/lto/type-merge2.ll Fri Apr 22 16:43:10 2016
@@ -1,6 +1,6 @@
; RUN: llvm-as %s -o %t.o
; RUN: llvm-as %p/Inputs/type-merge2.ll -o %t2.o
-; RUN: ld.lld -m elf_x86_64 %t.o %t2.o -o %t.so -shared -save-temps -lto-no-discard-value-names
+; RUN: ld.lld -m elf_x86_64 %t.o %t2.o -o %t.so -shared -save-temps
; RUN: llvm-dis %t.so.lto.bc -o - | FileCheck %s
target triple = "x86_64-unknown-linux-gnu"
More information about the llvm-commits
mailing list