[PATCH] D31963: ThinLTOBitcodeWriter: keep comdats together, rename if leader is renamed
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 11 17:49:03 PDT 2017
pcc added inline comments.
================
Comment at: lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:308
+ // comdat in MergedM to keep the comdat together.
+ DenseSet<StringRef> MergedMComdats;
+ for (const auto &GVar : M.globals())
----------------
Nit: I think you can collect `Comdat` pointers rather than `StringRef`s here.
================
Comment at: lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:310-312
+ if (const auto *C = GVar.getComdat())
+ if (HasTypeMetadata(&GVar))
+ MergedMComdats.insert(C->getName());
----------------
As I mentioned you could move lines 310 and 312 into the loop starting on line 290 above.
================
Comment at: lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:322
return EligibleVirtualFns.count(F);
- if (auto *GVar = dyn_cast_or_null<GlobalVariable>(GV->getBaseObject()))
+ else if (auto *GVar =
+ dyn_cast_or_null<GlobalVariable>(GV->getBaseObject()))
----------------
Remove else
https://reviews.llvm.org/D31963
More information about the llvm-commits
mailing list