@@ -199,51 +199,7 @@ class PassManager : public PassInfoMixin<
199199 // / Run all of the passes in this manager over the given unit of IR.
200200 // / ExtraArgs are passed to each pass.
201201 PreservedAnalyses run (IRUnitT &IR, AnalysisManagerT &AM,
202- ExtraArgTs... ExtraArgs) {
203- PreservedAnalyses PA = PreservedAnalyses::all ();
204-
205- // Request PassInstrumentation from analysis manager, will use it to run
206- // instrumenting callbacks for the passes later.
207- // Here we use std::tuple wrapper over getResult which helps to extract
208- // AnalysisManager's arguments out of the whole ExtraArgs set.
209- PassInstrumentation PI =
210- detail::getAnalysisResult<PassInstrumentationAnalysis>(
211- AM, IR, std::tuple<ExtraArgTs...>(ExtraArgs...));
212-
213- // RemoveDIs: if requested, convert debug-info to DbgRecord representation
214- // for duration of these passes.
215- ScopedDbgInfoFormatSetter FormatSetter (IR, UseNewDbgInfoFormat);
216-
217- for (auto &Pass : Passes) {
218- // Check the PassInstrumentation's BeforePass callbacks before running the
219- // pass, skip its execution completely if asked to (callback returns
220- // false).
221- if (!PI.runBeforePass <IRUnitT>(*Pass, IR))
222- continue ;
223-
224- PreservedAnalyses PassPA = Pass->run (IR, AM, ExtraArgs...);
225-
226- // Update the analysis manager as each pass runs and potentially
227- // invalidates analyses.
228- AM.invalidate (IR, PassPA);
229-
230- // Call onto PassInstrumentation's AfterPass callbacks immediately after
231- // running the pass.
232- PI.runAfterPass <IRUnitT>(*Pass, IR, PassPA);
233-
234- // Finally, intersect the preserved analyses to compute the aggregate
235- // preserved set for this pass manager.
236- PA.intersect (std::move (PassPA));
237- }
238-
239- // Invalidation was handled after each pass in the above loop for the
240- // current unit of IR. Therefore, the remaining analysis results in the
241- // AnalysisManager are preserved. We mark this with a set so that we don't
242- // need to inspect each one individually.
243- PA.preserveSet <AllAnalysesOn<IRUnitT>>();
244-
245- return PA;
246- }
202+ ExtraArgTs... ExtraArgs);
247203
248204 // FIXME: Revert to enable_if style when gcc >= 11.1
249205 template <typename PassT> LLVM_ATTRIBUTE_MINSIZE void addPass (PassT &&Pass) {
0 commit comments