diff options
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 46db3ed..38d7b77 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -5562,8 +5562,8 @@ Error BitcodeReader::materialize(GlobalValue *GV) { } } - // "Upgrade" older incorrect branch weights by dropping them. for (auto &I : instructions(F)) { + // "Upgrade" older incorrect branch weights by dropping them. if (auto *MD = I.getMetadata(LLVMContext::MD_prof)) { if (MD->getOperand(0) != nullptr && isa<MDString>(MD->getOperand(0))) { MDString *MDS = cast<MDString>(MD->getOperand(0)); @@ -5590,6 +5590,12 @@ Error BitcodeReader::materialize(GlobalValue *GV) { I.setMetadata(LLVMContext::MD_prof, nullptr); } } + + // Remove align from return attribute on CallInst. + if (auto *CI = dyn_cast<CallInst>(&I)) { + if (CI->getFunctionType()->getReturnType()->isVoidTy()) + CI->removeAttribute(0, Attribute::Alignment); + } } // Look for functions that rely on old function attribute behavior. |