Peng Yu via llvm-dev
2019-Feb-07 02:55 UTC
[llvm-dev] Not to consolidate two structs with the same data types (but different names) in configure/make tool chain
> https://llvm.org/docs/LangRef.html#structure-typesI don't follow the above link. Could you help explain what it means?> Fundamentally, llvm is not designed to preserve details about front end language features.If directly compile .c to .ll can preserve the original struct information even they are essentially the same, why flto can not? It seems to me that there must be a way to preserve such info if flto is used. -- Regards, Peng
Craig Topper via llvm-dev
2019-Feb-07 03:15 UTC
[llvm-dev] Not to consolidate two structs with the same data types (but different names) in configure/make tool chain
LTO has to merge the modules from different translation units. Those modules very likely have duplicate types in them so LTO merges them to avoid wasting memory on duplicates. ~Craig On Wed, Feb 6, 2019 at 6:55 PM Peng Yu via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > https://llvm.org/docs/LangRef.html#structure-types > > I don't follow the above link. Could you help explain what it means? > > > Fundamentally, llvm is not designed to preserve details about front end > language features. > > If directly compile .c to .ll can preserve the original struct > information even they are essentially the same, why flto can not? It > seems to me that there must be a way to preserve such info if flto is > used. > > -- > Regards, > Peng > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190206/ae39c897/attachment.html>
Peng Yu via llvm-dev
2019-Feb-07 03:18 UTC
[llvm-dev] Not to consolidate two structs with the same data types (but different names) in configure/make tool chain
> LTO has to merge the modules from different translation units. Those modules very likely have duplicate types in them so LTO merges them to avoid wasting memory on duplicates.But I am checking the *.preopt.bc. Since it is before any optimization, I'd expect such merging should not occur. -- Regards, Peng