[llvm] [Analysis] Avoid running transform passes that have just been run (PR #112092)
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 23 08:49:44 PDT 2024
================
@@ -0,0 +1,109 @@
+//===- LastRunTrackingAnalysis.h - Avoid running redundant pass -*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This is an analysis pass to track a set of passes that have been run, so that
+// we can avoid running a pass again if there is no change since the last run of
+// the pass.
+//
+// In this analysis we track a set of passes S for each function with the
+// following transition rules:
+// 1. If pass P make changes, set S = {P}.
+// 2. If pass P doesn't make changes, set S = S + {P}.
+//
+// Before running a pass P which satisfies P(P(x)) == P(x), we check if P is in
+// S. If so, we skip this pass since we know that there will be no change.
+//
+// Notes:
+// 1. Some transform passes have parameters that may vary in the optimization
+// pipeline. We should check if parameters in current run is compatible with
+// that in the last run.
+// 2. Module passes are specially handled. If a module pass make changes, we
----------------
aeubanks wrote:
what do you mean "module passes are specially handled"? it looks like they're treated the same as function passes
https://github.com/llvm/llvm-project/pull/112092
More information about the llvm-commits
mailing list