[PATCH] D70006: [ThinLTO] Fix bug when importing writeonly variables

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 09:49:22 PST 2019


tejohnson accepted this revision.
tejohnson added a comment.
This revision is now accepted and ready to land.

Let's get this one in (I have a couple more comment nits below), to fix the immediate problem. But please send a follow on patch soon to do the assertion checking I suggested in my earlier comment, to make sure we catch any regressions to the force import of these write only variables.



================
Comment at: llvm/lib/IR/ModuleSummaryIndex.cpp:204
+    // Definition of writeonly GV with non-trivial initializer should also
+    // be imported. Not doing so will result in:
+    // a) GV internalization in source module (because it's writeonly)
----------------
Add that this is because we don't AnalyzeRefs when propagating the write only property.


================
Comment at: llvm/lib/Transforms/Utils/FunctionImportUtils.cpp:260
+        // promoted, because there is no any kind of read access to them
+        // on behalf of this writeonly GV. To avoid promotion we convert
+        // GV initializer to 'zeroinitializer'. This effectively drops
----------------
Please add that this is because we do not export their references.


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

https://reviews.llvm.org/D70006





More information about the llvm-commits mailing list