diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp --- a/llvm/lib/Passes/PassBuilderPipelines.cpp +++ b/llvm/lib/Passes/PassBuilderPipelines.cpp @@ -1708,11 +1708,12 @@ // valuable as the inliner doesn't currently care whether it is inlining an // invoke or a call. // Run the inliner now. - MPM.addPass(ModuleInlinerWrapperPass( - getInlineParamsFromOptLevel(Level), - /* MandatoryFirst */ true, - InlineContext{ThinOrFullLTOPhase::FullLTOPostLink, - InlinePass::CGSCCInliner})); + if (EnableModuleInliner){ + MPM.addPass(buildModuleInlinerPipeline(Level, ThinOrFullLTOPhase::FullLTOPostLink)); + } + else{ + MPM.addPass(buildInlinerPipeline(Level, ThinOrFullLTOPhase::FullLTOPostLink)); + } // Perform context disambiguation after inlining, since that would reduce the // amount of additional cloning required to distinguish the allocation