diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp --- a/llvm/lib/Analysis/LazyCallGraph.cpp +++ b/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(); - return !(PAC.preserved() || PAC.preservedSet>() || - PAC.preservedSet()); + return !(PAC.preserved() || PAC.preservedSet>()); } LazyCallGraph &LazyCallGraph::operator=(LazyCallGraph &&G) { diff --git a/llvm/test/Analysis/LazyCallGraph/invalidate.ll b/llvm/test/Analysis/LazyCallGraph/invalidate.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Analysis/LazyCallGraph/invalidate.ll @@ -0,0 +1,33 @@ +; REQUIRES: x86-registered-target +; RUN: opt -passes='cgscc(no-op-cgscc),function(slp-vectorizer),cgscc(function(sroa))' -debug-pass-manager < %s 2>&1 | FileCheck %s + +; CHECK: Invalidating {{.*}} LazyCallGraph + +target triple = "x86_64-unknown-linux-gnu" + +define i16 @my_lookup() { +entry: + %lbl_addrs = alloca [3 x i8*], align 1 + store i8* blockaddress(@my_lookup, %lbl2), i8** undef, align 1 + %arrayinit.element1 = getelementptr inbounds i8*, i8** undef, i32 1 + store i8* blockaddress(@my_lookup, %lbl3), i8** %arrayinit.element1, align 1 + callbr void asm sideeffect "bra $0", "a,X,X,X"(i8* undef, i8* blockaddress(@my_lookup, %lbl1), i8* blockaddress(@my_lookup, %lbl2), i8* blockaddress(@my_lookup, %lbl3)) + to label %asm.fallthrough [label %lbl1, label %lbl2, label %lbl3] + +asm.fallthrough: ; preds = %entry + unreachable + +lbl1: ; preds = %entry + ret i16 undef + +lbl2: ; preds = %entry + unreachable + +lbl3: ; preds = %entry + unreachable +} + +define void @idi() { +entry: + ret void +}