[PATCH] D70977: [ThinLTO] Fix importing of writeonly variables in distributed ThinLTO

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 12:43:51 PST 2019


tejohnson created this revision.
tejohnson added reviewers: evgeny777, steven_wu.
Herald added subscribers: arphaman, dexonsmith, hiraditya, inglorion, mehdi_amini.
Herald added a project: LLVM.

D69561 <https://reviews.llvm.org/D69561>/dde5893 <https://reviews.llvm.org/rGdde589389fcb8b5098f7a47f1b781b27d29a0cac> enabled importing of readonly variables with references,
however, it introduced a bug relating to importing/internalization of
writeonly variables with references.

A fix for this was added in D70006 <https://reviews.llvm.org/D70006>/7f92d66 <https://reviews.llvm.org/rG7f92d66f378574ab2a02935b6614560ae9000539>. But this didn't work in
distributed ThinLTO mode. The reason is that the fix (importing the
writeonly var with a zeroinitializer) was only applied when there were
references on the writeonly var summary. In distributed ThinLTO mode,
where we only have a small slice of the index, we will not have the
references on the importing side if we are not importing those
referenced values. Rather than changing this handshaking (which will
require a lot of other changes, since that's how we know what to import
in the distributed backend clang invocation), we can simply always give
the writeonly variable a zero initializer.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70977

Files:
  llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
  llvm/test/ThinLTO/X86/index-const-prop2.ll
  llvm/test/ThinLTO/X86/writeonly-with-refs.ll
  llvm/test/ThinLTO/X86/writeonly.ll
  llvm/test/ThinLTO/X86/writeonly2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70977.231963.patch
Type: text/x-patch
Size: 5007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191203/e46f136b/attachment.bin>


More information about the llvm-commits mailing list