ThinLTO may skip object for other reasons, e.g. if there is no summary.
Details
Diff Detail
- Build Status
Buildable 14406 Build 14406: arc lint + arc unit
Event Timeline
I guess this is needed for the case when we need to split the module due to the existence of type metadata, but there is no module id so we can only write as regular LTO?
llvm/tools/gold/gold-plugin.cpp | ||
---|---|---|
896 | It would be good to avoid writing all these files unnecessarily (the common case). You could presumably get back from LTO::add (via addModule below) whether any module in the file had a summary (from the BitcodeLTOInfo structure in LTO::addModule). |
llvm/tools/gold/gold-plugin.cpp | ||
---|---|---|
896 | Done, but in a little bit different way. We can just inform the caller about what was actually written. This way we can avoid having in the gold plugin the logic which checks LTO properties and decides what should be written or skipped. |
llvm/include/llvm/LTO/LTO.h | ||
---|---|---|
220 | Document new param | |
llvm/tools/gold/gold-plugin.cpp | ||
896 | Should this have been removed now? | |
llvm/tools/llvm-lto2/llvm-lto2.cpp | ||
247 | I think the only change here is the addition of the braces - I assume that was from some debugging code that was since removed, so the braces and the change to this file can be removed. |
addressed comments
llvm/tools/gold/gold-plugin.cpp | ||
---|---|---|
896 | Ugh, removing this was the point of the patch. Probably result of invalid local merges. |
llvm/tools/gold/gold-plugin.cpp | ||
---|---|---|
873 | Thinking through this some more, this seems a little dicey, because it assumes that createLTO will never try to access these filename strings that are owned by this set after the callback. In fact, that doesn't even seem to be the case currently (ModulePath which is a StringRef of the module identifier is passed to EmitImportsFiles after this callback is invoked). Rather than try to fix that, since it would still be fragile, I suggest making this a StringMap and noting in the map whether the file was written. | |
llvm/tools/llvm-lto2/llvm-lto2.cpp | ||
247 | Oh I see, there was a change here. In any case, please remove the added braces which aren't necessary. |
llvm/tools/gold/gold-plugin.cpp | ||
---|---|---|
873 | Oh, I've totally missed "owning" part in the first place. |
Document new param