Upgrade TBAA *before* upgrading intrinsics
Summary: If TBAA is on an intrinsic and it gets upgraded and drops the TBAA we hit an odd assert. We should just upgrade the TBAA first because it doesn't have side-effects. Reviewers: reames, apilipenko, manmanren Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18229 llvm-svn: 263673
This commit is contained in:
@@ -5334,6 +5334,11 @@ std::error_code BitcodeReader::materializeModule() {
|
||||
if (!BasicBlockFwdRefs.empty())
|
||||
return error("Never resolved function from blockaddress");
|
||||
|
||||
// Upgrading intrinsic calls before TBAA can cause TBAA metadata to be lost,
|
||||
// to prevent this instructions with TBAA tags should be upgraded first.
|
||||
for (unsigned I = 0, E = InstsWithTBAATag.size(); I < E; I++)
|
||||
UpgradeInstWithTBAATag(InstsWithTBAATag[I]);
|
||||
|
||||
// Upgrade any intrinsic calls that slipped through (should not happen!) and
|
||||
// delete the old functions to clean up. We can't do this unless the entire
|
||||
// module is materialized because there could always be another function body
|
||||
@@ -5349,9 +5354,6 @@ std::error_code BitcodeReader::materializeModule() {
|
||||
}
|
||||
UpgradedIntrinsics.clear();
|
||||
|
||||
for (unsigned I = 0, E = InstsWithTBAATag.size(); I < E; I++)
|
||||
UpgradeInstWithTBAATag(InstsWithTBAATag[I]);
|
||||
|
||||
UpgradeDebugInfo(*TheModule);
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user