diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-09-04 16:09:01 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-09-04 16:09:01 +0000 |
| commit | 128c5ea902b54aee7cdc744eff3cd59feb83aedd (patch) | |
| tree | ced482fe5a3ebbdb5c5c3b9336f98abe5e987776 /llvm/test/Transforms/GlobalOpt | |
| parent | 7d2abdf017b1d4573075ba75419f6fc62c415e3d (diff) | |
| download | bcm5719-llvm-128c5ea902b54aee7cdc744eff3cd59feb83aedd.tar.gz bcm5719-llvm-128c5ea902b54aee7cdc744eff3cd59feb83aedd.zip | |
Revert "Add r159136 back now that pr13124 has been fixed."
This reverts commit r189886.
I found a corner case where this optimization is not valid:
Say we have a "linkonce_odr unnamed_addr" in two translation units:
* In TU 1 this optimization kicks in and makes it hidden.
* In TU 2 it gets const merged with a constant that is *not* unnamed_addr,
resulting in a non unnamed_addr constant with default visibility.
* The static linker rules for combining visibility them produce a hidden
symbol, which is incorrect from the point of view of the non unnamed_addr
constant.
The one place we can do this is when we know that the symbol is not used from
another TU in the same shared object, i.e., during LTO. I will move it there.
llvm-svn: 189954
Diffstat (limited to 'llvm/test/Transforms/GlobalOpt')
| -rw-r--r-- | llvm/test/Transforms/GlobalOpt/hidden.ll | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/llvm/test/Transforms/GlobalOpt/hidden.ll b/llvm/test/Transforms/GlobalOpt/hidden.ll deleted file mode 100644 index 301e158d534..00000000000 --- a/llvm/test/Transforms/GlobalOpt/hidden.ll +++ /dev/null @@ -1,14 +0,0 @@ -; RUN: opt %s -globalopt -S | FileCheck %s - -@foo = linkonce_odr unnamed_addr constant i32 42 -; CHECK: @foo = linkonce_odr hidden unnamed_addr constant i32 42 - -define linkonce_odr void @bar() unnamed_addr { -; CHECK: define linkonce_odr hidden void @bar() unnamed_addr { - ret void -} - -define i32* @zed() { - call void @bar() - ret i32* @foo -} |

