Regular LTO modules do not need LTO Unit splitting, only ThinLTO does
(they must be consistently split into regular and Thin units for
optimizations such as whole program devirtualization and lower type
tests). In order to avoid spurious errors from LTO when combining with
split ThinLTO modules, always set this flag for regular LTO modules.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Sorry, just realized this. If I do
clang++ -c -flto a.cpp # "split" clang++ -c -flto=thin b.cpp -fwhole-program-vtables # non-split clang++ a.o b.o
this should fail, right? If I'm not mistaken, this patch series will cause this to succeed. I think we need to change this patch so that it always sets EnableSplitLTOUnit to 1 for regular LTO, then you can drop the other patch.
Comment Actions
This is a good point. We could detect and handle this during the LTO merging here, but I don't think it is worth it (it would essentially be treating regular LTO as split in any case). The change you suggested fixes the original bug, re running the llvm/clang tests now and will update the patches afterwards.