diff options
author | David Blaikie <dblaikie@gmail.com> | 2017-07-27 15:09:06 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2017-07-27 15:09:06 +0000 |
commit | 2f0cc477ab1a8409a804a420739cbd40b1dd8f4a (patch) | |
tree | 05fd9102a243b95372d8468f6232b237c2143429 /llvm/test/Transforms/FunctionImport | |
parent | 0d543b5921c4cf5fe150700b505f867a9fac39a8 (diff) | |
download | bcm5719-llvm-2f0cc477ab1a8409a804a420739cbd40b1dd8f4a.tar.gz bcm5719-llvm-2f0cc477ab1a8409a804a420739cbd40b1dd8f4a.zip |
ThinLTO: Don't import aliases of any kind (even linkonce_odr)
Summary:
Until a more advanced version of importing can be implemented for
aliases (one that imports an alias as an available_externally definition
of the aliasee), skip the narrow subset of cases that was possible but
came at a cost: aliases of linkonce_odr functions could be imported
because the linkonce_odr function could be safely duplicated from the
source module. This came/comes at the cost of not being able to 'home'
imported linkonce functions (they had to be emitted linkonce_odr in all
the destination modules (even if they weren't used by an alias) rather
than as available_externally - causing extra object size).
Tangentially, this also was the only reason ThinLTO would emit multiple
CUs in to the resulting DWARF - which happens to be a problem for
Fission (there's a fix for this in GDB but not released yet, etc).
(actually it's not the only reason - but I'm sending a patch to fix the
other reason shortly)
There's no reason to believe this particularly narrow alias importing
was especially/meaningfully important, only that it was /possible/ to
implement in this way. When a more general solution is done, it should
still satisfy the DWARF concerns above, since the import will still be
available_externally, and thus not create extra CUs.
Since now all aliases are treated the same, I removed/simplified some
test cases since they were testing corner cases where there are no
longer any corners.
Reviewers: tejohnson, mehdi_amini
Differential Revision: https://reviews.llvm.org/D35875
llvm-svn: 309278
Diffstat (limited to 'llvm/test/Transforms/FunctionImport')
-rw-r--r-- | llvm/test/Transforms/FunctionImport/funcimport.ll | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/test/Transforms/FunctionImport/funcimport.ll b/llvm/test/Transforms/FunctionImport/funcimport.ll index cc732a3bd98..1aafd00318c 100644 --- a/llvm/test/Transforms/FunctionImport/funcimport.ll +++ b/llvm/test/Transforms/FunctionImport/funcimport.ll @@ -40,12 +40,9 @@ declare void @weakalias(...) #1 ; CHECK-DAG: declare void @analias declare void @analias(...) #1 -; Aliases import the aliasee function +; Aliases are not imported declare void @linkoncealias(...) #1 -; INSTLIMDEF-DAG: Import linkoncealias -; INSTLIMDEF-DAG: Import linkoncefunc -; CHECK-DAG: define linkonce_odr void @linkoncefunc() -; CHECK-DAG: @linkoncealias = alias void (...), bitcast (void ()* @linkoncefunc to void (...)* +; CHECK-DAG: declare void @linkoncealias(...) ; INSTLIMDEF-DAG: Import referencestatics ; INSTLIMDEF-DAG: define available_externally i32 @referencestatics(i32 %i) !thinlto_src_module !0 { @@ -108,7 +105,7 @@ declare void @linkoncefunc2(...) #1 declare void @variadic(...) ; INSTLIMDEF-DAG: Import globalfunc2 -; INSTLIMDEF-DAG: 13 function-import - Number of functions imported +; INSTLIMDEF-DAG: 11 function-import - Number of functions imported ; CHECK-DAG: !0 = !{!"{{.*}}/Inputs/funcimport.ll"} ; The actual GUID values will depend on path to test. |