diff options
author | Chris Bieneman <beanz@apple.com> | 2016-03-16 23:17:54 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2016-03-16 23:17:54 +0000 |
commit | 671d0dda7dcb70115a887936e6d8e58b426bd4c2 (patch) | |
tree | bbdcee110a7b5f05cfadb1ac0bd704ed394f55ce /llvm/lib/Bitcode/Reader | |
parent | 43e33d61c681f221b03fac71d21044173e33cb0c (diff) | |
download | bcm5719-llvm-671d0dda7dcb70115a887936e6d8e58b426bd4c2.tar.gz bcm5719-llvm-671d0dda7dcb70115a887936e6d8e58b426bd4c2.zip |
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
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 8d749c29108..fd9a5e5c5ef 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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(); } |