1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Critical fix- function inlining was broken

This commit is contained in:
Brian Fiete 2020-03-24 07:09:29 -07:00
parent cdabb18d9f
commit b8437bc67c

View file

@ -106,6 +106,8 @@
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/Bitcode/BitcodeWriterPass.h"
#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"
#include "llvm/Transforms/IPO/AlwaysInliner.h"
#include "llvm/Transforms/IPO.h"
#include "../LLVMUtils.h"
@ -3580,12 +3582,17 @@ static void PopulateModulePassManager(llvm::legacy::PassManagerBase &MPM, const
// MPM.add(createPruneEHPass());
// MPM.add(createSampleProfileLoaderPass(PGOSampleUse));
// }
llvm::Pass* Inliner = NULL;
llvm::Pass* Inliner;
bool prepareForLTO = false;
bool prepareForThinLTO = options.mLTOType == BfLTOType_Thin;
bool performThinLTO = false;
bool enableNonLTOGlobalsModRef = false;
if (GetOptLevel(options.mOptLevel) > 0)
Inliner = llvm::createFunctionInliningPass(GetOptLevel(options.mOptLevel), options.mSizeLevel, false);
else
Inliner = llvm::createAlwaysInlinerLegacyPass();
// Allow forcing function attributes as a debugging and tuning aid.
MPM.add(llvm::createForceFunctionAttrsLegacyPass());