[llvm] [Analysis] Avoid running transform passes that have just been run (PR #112092)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 16:44:15 PDT 2024


================
@@ -43,12 +43,19 @@ struct InstCombineOptions {
     MaxIterations = Value;
     return *this;
   }
+
+  /// Only enable skipping when two versions of parameters are exactly the same.
+  bool isCompatibleWith(const InstCombineOptions &LastOption) const {
+    return VerifyFixpoint == LastOption.VerifyFixpoint &&
+           MaxIterations == LastOption.MaxIterations;
+  }
 };
 
 class InstCombinePass : public PassInfoMixin<InstCombinePass> {
 private:
   InstructionWorklist Worklist;
   InstCombineOptions Options;
+  static char ID;
----------------
mshockwave wrote:

new PassManager Passes don't need `ID` IIRC.

https://github.com/llvm/llvm-project/pull/112092


More information about the llvm-commits mailing list