Skip to content

Commit

Permalink
Unrolled build for rust-lang#130850
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#130850 - saveasguy:pass-mam-to-standrd-instrumentations, r=nikic

Pass Module Analysis Manager to Standard Instrumentations

This PR introduces changes related to llvm::PassInstrumentationCallbacks. Now, we pass Module Analysis Manager to StandardInstrumentations::registerCallbacks, so it can take advantage of such instrumentations as IR verifier or preserved CFG checker. So basically this is NFC PR.
  • Loading branch information
rust-timer authored Sep 27, 2024
2 parents 2bd1e89 + afb7eef commit 36bcde7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,12 +732,7 @@ extern "C" LLVMRustResult LLVMRustOptimize(
PTO.SLPVectorization = SLPVectorize;
PTO.MergeFunctions = MergeFunctions;

// FIXME: We may want to expose this as an option.
bool DebugPassManager = false;

PassInstrumentationCallbacks PIC;
StandardInstrumentations SI(TheModule->getContext(), DebugPassManager);
SI.registerCallbacks(PIC);

if (LlvmSelfProfiler) {
LLVMSelfProfileInitializeCallbacks(PIC, LlvmSelfProfiler,
Expand Down Expand Up @@ -784,6 +779,12 @@ extern "C" LLVMRustResult LLVMRustOptimize(
CGSCCAnalysisManager CGAM;
ModuleAnalysisManager MAM;

// FIXME: We may want to expose this as an option.
bool DebugPassManager = false;

StandardInstrumentations SI(TheModule->getContext(), DebugPassManager);
SI.registerCallbacks(PIC, &MAM);

if (LLVMPluginsLen) {
auto PluginsStr = StringRef(LLVMPlugins, LLVMPluginsLen);
SmallVector<StringRef> Plugins;
Expand Down

0 comments on commit 36bcde7

Please sign in to comment.