Fix attributes of build_PlainMetaAddress function

These allow it to be DCE'd and CSE'd if possible directly by LLVM
instead of requiring us to handle it esplicitly as a special case.
This commit is contained in:
Pietro Fezzardi
2023-03-03 17:56:09 +01:00
committed by Kacper Kołodziej
parent 022aeb0df3
commit 43297efad0
+3
View File
@@ -368,6 +368,9 @@ static llvm::Value *buildPlainMetaAddressImpl(llvm::IRBuilder<> &Builder,
Module *M = BB->getParent()->getParent();
Function *MetaAddressConstuctor = M->getFunction("build_PlainMetaAddress");
MetaAddressConstuctor->addFnAttr(Attribute::WillReturn);
MetaAddressConstuctor->addFnAttr(Attribute::NoUnwind);
MetaAddressConstuctor->addFnAttr(Attribute::ReadNone);
auto *FT = MetaAddressConstuctor->getFunctionType();
return Builder
.CreateCall(MetaAddressConstuctor,