[PATCH] D111275: [LCG] Don't skip invalidation of LazyCallGraph if CFG analyses are preserved

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 13:18:22 PDT 2021


aeubanks updated this revision to Diff 378777.
aeubanks added a comment.

simplify test


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111275/new/

https://reviews.llvm.org/D111275

Files:
  llvm/lib/Analysis/LazyCallGraph.cpp
  llvm/test/Analysis/LazyCallGraph/invalidate.ll


Index: llvm/test/Analysis/LazyCallGraph/invalidate.ll
===================================================================
--- /dev/null
+++ llvm/test/Analysis/LazyCallGraph/invalidate.ll
@@ -0,0 +1,10 @@
+; Make sure we invalidate lcg even when preserving domtree
+; RUN: opt -passes='require<lcg>,function(instcombine)' -debug-pass-manager -disable-output < %s 2>&1 | FileCheck %s
+
+; CHECK: Invalidating {{.*}} LazyCallGraphAnalysis
+
+define void @f() {
+lbl:
+  %a = add i32 1, 2
+  unreachable
+}
Index: llvm/lib/Analysis/LazyCallGraph.cpp
===================================================================
--- llvm/lib/Analysis/LazyCallGraph.cpp
+++ llvm/lib/Analysis/LazyCallGraph.cpp
@@ -220,8 +220,7 @@
   // Check whether the analysis, all analyses on functions, or the function's
   // CFG have been preserved.
   auto PAC = PA.getChecker<llvm::LazyCallGraphAnalysis>();
-  return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Module>>() ||
-           PAC.preservedSet<CFGAnalyses>());
+  return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Module>>());
 }
 
 LazyCallGraph &LazyCallGraph::operator=(LazyCallGraph &&G) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111275.378777.patch
Type: text/x-patch
Size: 1148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211011/25d53028/attachment.bin>


More information about the llvm-commits mailing list