[PATCH] D55060: [ThinLTO] Look through aliases in cache key calculations
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 30 10:53:31 PST 2018
tejohnson added inline comments.
================
Comment at: lib/LTO/LTO.cpp:189
+ // about information on the aliasee.
+ GS = GS->getBaseObject();
+
----------------
By skipping the alias here, we don't end up hashing its own live bit. I have a suggestion below.
================
Comment at: lib/LTO/LTO.cpp:223
AddUsedCfiGlobal(GS.first);
AddUsedThings(GS.second);
}
----------------
This loop will call AddUsedThings for every global defined in this module, so presumably this already handles both the alias and the base object.
================
Comment at: lib/LTO/LTO.cpp:230
for (auto &ImpF : ImpM.second)
AddUsedThings(Index.findSummaryInModule(ImpF, ImpM.first()));
----------------
Presumably this is where we were missing the base object, because we may have the alias in the import list but not its base object (but we will actually import the alias as a copy of the base object). My suggestion would be to check if the summary is an alias here, and if so call AddUsedThings a second time on the base object summary.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55060/new/
https://reviews.llvm.org/D55060
More information about the llvm-commits
mailing list