[llvm] 7ae92a6 - [MLInliner] No need to invalidate everything post-inlining.

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 24 18:22:25 PDT 2022


Author: Mircea Trofin
Date: 2022-06-24T18:22:06-07:00
New Revision: 7ae92a69c2f3ddd3d41cbc5c808d240184b394d0

URL: https://github.com/llvm/llvm-project/commit/7ae92a69c2f3ddd3d41cbc5c808d240184b394d0
DIFF: https://github.com/llvm/llvm-project/commit/7ae92a69c2f3ddd3d41cbc5c808d240184b394d0.diff

LOG: [MLInliner] No need to invalidate everything post-inlining.

We really just need to invalidate loop info and the dominator tree, in
addition to the FunctionPropertiesInfo we were invalidating originally.
Doing more adds unnecessary compile time overhead.

Added: 
    

Modified: 
    llvm/lib/Analysis/MLInlineAdvisor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/MLInlineAdvisor.cpp b/llvm/lib/Analysis/MLInlineAdvisor.cpp
index 1a7cdc38471bb..f55de71ea98ae 100644
--- a/llvm/lib/Analysis/MLInlineAdvisor.cpp
+++ b/llvm/lib/Analysis/MLInlineAdvisor.cpp
@@ -232,7 +232,10 @@ void MLInlineAdvisor::onSuccessfulInlining(const MLInlineAdvice &Advice,
   Function *Callee = Advice.getCallee();
   // The caller features aren't valid anymore.
   {
-    PreservedAnalyses PA = PreservedAnalyses::none();
+    PreservedAnalyses PA = PreservedAnalyses::all();
+    PA.abandon<FunctionPropertiesAnalysis>();
+    PA.abandon<DominatorTreeAnalysis>();
+    PA.abandon<LoopAnalysis>();
     FAM.invalidate(*Caller, PA);
   }
   Advice.updateCachedCallerFPI(FAM);


        


More information about the llvm-commits mailing list