[PATCH] D19308: ThinLTO: Resolve linkonce_odr aliases just like functions

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 12:18:03 PDT 2016


tejohnson added a comment.

Were you going to move your old test/ThinLTO/X86/alias_resolution.ll from http://reviews.llvm.org/D19096 to here?


================
Comment at: lib/LTO/ThinLTOCodeGenerator.cpp:161
@@ +160,3 @@
+      // Alias can't be turned into available_externally.
+      return OriginalLinkage;
+    return GlobalValue::AvailableExternallyLinkage;
----------------
joker.eph wrote:
> tejohnson wrote:
> > Since this is a variant of similar handling that used to be here for the aliasee in D19096 (since removed), I will copy over a variant of my suggestion from back then:
> > 
> > I think it would be helpful to add a comment here about how this works. I.e. something like "If a non-imported alias that remains linkonce is referenced by an imported function, the IRMover will create a corresponding ExternalLinkage declaration, which will be satisfied at link time with the copy that was resolved to WeakODR."
> Your sentence is not clear to me, I'm not sure if I misunderstand because it does not seems to apply.  See also line 170 for the general explanation that seems to cover what happens here (nothing is really specific to alias for the resolution).
> 
> The only specificity here with alias is we can't turn them into available_externally.
> We turn ODR functions (even if they have a callee remaining in the current module) into available externally to *force* dropping them.
> 
> 
> 
True, the same explanation is valid for why the available_externally works since it is discardable as well. I think the explanation at line 170 is sufficient.


http://reviews.llvm.org/D19308





More information about the llvm-commits mailing list