[PATCH] D49434: Put "built-in" function definitions in global Used list, for LTO. (fix bug 34169)

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 14:07:22 PDT 2018


tejohnson added a comment.

In https://reviews.llvm.org/D49434#1165612, @pcc wrote:

> You wouldn't be making changes to the IR, only the summary. I was thinking that you might add code to http://llvm-cs.pcc.me.uk/lib/Analysis/ModuleSummaryAnalysis.cpp#534 that would effectively do:
>
>   if (ValueInfo VI = Index.getValueInfo(GlobalValue::getGUID("memcpy")))
>       for (auto &Summary : VI.getSummaryList())
>         Summary->setLive(true);
>   if (ValueInfo VI = Index.getValueInfo(GlobalValue::getGUID("memmove")))
>       for (auto &Summary : VI.getSummaryList())
>         Summary->setLive(true);
>   // etc.
>


If I recall correctly it wasn't the LTO dead code elimination that was removing them. Caroline, I forget what was happening in the original case - were they being internalized by LTO and then eliminated by GlobalDCE? If so, then Peter's approach should fix the issue by preventing them from being internalized (at least by ThinLTO, not sure about regular LTO).


https://reviews.llvm.org/D49434





More information about the llvm-commits mailing list