Consistently use LLVM lifetime markers during codegen

Ensure that inliner inserts lifetime markers if they have been emitted during
codegen. Otherwise if allocas from inlined functions are merged together,
lifetime markers from one function might invalidate load & stores performed
by the other one.
This commit is contained in:
Tomasz Miąsko 2020-05-13 00:00:00 +00:00
parent 23ffeea307
commit bbb63d4554
7 changed files with 50 additions and 13 deletions

View file

@ -717,7 +717,7 @@ LLVMRustOptimizeWithNewPassManager(
LLVMRustOptStage OptStage,
bool NoPrepopulatePasses, bool VerifyIR, bool UseThinLTOBuffers,
bool MergeFunctions, bool UnrollLoops, bool SLPVectorize, bool LoopVectorize,
bool DisableSimplifyLibCalls,
bool DisableSimplifyLibCalls, bool EmitLifetimeMarkers,
LLVMRustSanitizerOptions *SanitizerOptions,
const char *PGOGenPath, const char *PGOUsePath,
void* LlvmSelfProfiler,
@ -853,7 +853,7 @@ LLVMRustOptimizeWithNewPassManager(
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
}
MPM.addPass(AlwaysInlinerPass(/*InsertLifetimeIntrinsics=*/false));
MPM.addPass(AlwaysInlinerPass(EmitLifetimeMarkers));
#if LLVM_VERSION_GE(10, 0)
if (PGOOpt) {