[PATCH] D70404: [ThinLTO] Always import constants

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 00:14:16 PST 2019


evgeny777 added a comment.

>   Out of curiosity, what problem do you run into when you unify ReadOnly with Constant?

When constant is always treated as `ReadOnly` it is also always internalized. Now if constant 'A' references constant 'B' in initializer you also have to import constant 'B' when constant 'A' is imported. Otherwise there is linker undef,
because both A and B are internal. This requires recursive variable import which we currently lack.

The more serious problem however is that if constant is not `unnamed_addr` you can't internalize it at all, because you may end up with different copies of it, each having unique address. So in any case some extra attribute in
GlobalVarSummary is needed to indicate if we can internalize ReadOnly var or not.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70404/new/

https://reviews.llvm.org/D70404





More information about the llvm-commits mailing list