diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-31 20:51:58 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-31 20:51:58 +0000 |
commit | 7e667c56cf7e27ff521ceb86518beab32bfb630d (patch) | |
tree | 70a76ad0c4af2d93a15e630ebd9864665253a72f /test/Transforms | |
parent | f7ba4897302bf930f7ec4682a296ff4cd736a0e3 (diff) | |
download | external_llvm-7e667c56cf7e27ff521ceb86518beab32bfb630d.zip external_llvm-7e667c56cf7e27ff521ceb86518beab32bfb630d.tar.gz external_llvm-7e667c56cf7e27ff521ceb86518beab32bfb630d.tar.bz2 |
Use LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN instead of the "dso list".
There are two ways one could implement hiding of linkonce_odr symbols in LTO:
* LLVM tells the linker which symbols can be hidden if not used from native
files.
* The linker tells LLVM which symbols are not used from other object files,
but will be put in the dso symbol table if present.
GOLD's API is the second option. It was implemented almost 1:1 in llvm by
passing the list down to internalize.
LLVM already had partial support for the first option. It is also very similar
to how ld64 handles hiding these symbols when *not* doing LTO.
This patch then
* removes the APIs for the DSO list.
* marks LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN all linkonce_odr unnamed_addr
global values and other linkonce_odr whose address is not used.
* makes the gold plugin responsible for handling the API mismatch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/Internalize/linkonce_odr_func.ll | 37 | ||||
-rw-r--r-- | test/Transforms/Internalize/lists.ll | 16 |
2 files changed, 0 insertions, 53 deletions
diff --git a/test/Transforms/Internalize/linkonce_odr_func.ll b/test/Transforms/Internalize/linkonce_odr_func.ll deleted file mode 100644 index c82acc0..0000000 --- a/test/Transforms/Internalize/linkonce_odr_func.ll +++ /dev/null @@ -1,37 +0,0 @@ -; RUN: opt < %s -internalize -internalize-dso-list foo1,foo2,foo3,foo4 -S | FileCheck %s - -; CHECK: define internal void @foo1( -define linkonce_odr void @foo1() noinline { - ret void -} - -; CHECK: define linkonce_odr void @foo2( -define linkonce_odr void @foo2() noinline { - ret void -} - -; CHECK: define internal void @foo3( -define linkonce_odr void @foo3() noinline { - ret void -} - -; CHECK: define linkonce_odr void @foo4( -define linkonce_odr void @foo4() noinline { - ret void -} - -declare void @f(void()*) - -define void @bar() { -bb0: - call void @foo1() - call void @f(void()* @foo2) - invoke void @foo3() to label %bb1 unwind label %clean -bb1: - invoke void @f(void()* @foo4) to label %bb2 unwind label %clean -bb2: - ret void -clean: - landingpad i32 personality i8* null cleanup - ret void -} diff --git a/test/Transforms/Internalize/lists.ll b/test/Transforms/Internalize/lists.ll index 3ebf0ed..83e441a2 100644 --- a/test/Transforms/Internalize/lists.ll +++ b/test/Transforms/Internalize/lists.ll @@ -13,10 +13,6 @@ ; -file and -list options should be merged, the apifile contains foo and j ; RUN: opt < %s -internalize -internalize-public-api-list bar -internalize-public-api-file %S/apifile -S | FileCheck --check-prefix=FOO_J_AND_BAR %s -; Put zed1 and zed2 in the symbol table. If the address is not relevant, we -; internalize them. -; RUN: opt < %s -internalize -internalize-dso-list zed1,zed2,zed3 -S | FileCheck --check-prefix=ZEDS %s - ; ALL: @i = internal global ; FOO_AND_J: @i = internal global ; FOO_AND_BAR: @i = internal global @@ -29,18 +25,6 @@ ; FOO_J_AND_BAR: @j = global @j = global i32 0 -; ZEDS: @zed1 = internal global i32 42 -@zed1 = linkonce_odr global i32 42 - -; ZEDS: @zed2 = internal unnamed_addr global i32 42 -@zed2 = linkonce_odr unnamed_addr global i32 42 - -; ZEDS: @zed3 = linkonce_odr global i32 42 -@zed3 = linkonce_odr global i32 42 -define i32* @get_zed3() { - ret i32* @zed3 -} - ; ALL: define internal void @main() { ; FOO_AND_J: define internal void @main() { ; FOO_AND_BAR: define internal void @main() { |