From 051bdb0b22a3eba1d8eb97f071195a13559a965a Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 12 Jul 2017 09:08:11 +0000 Subject: [PATCH] [PM] Fix a silly bug in my recent update to the CG update logic. I used the wrong variable to update. This was even covered by a unittest I wrote, and the comments for the unittest were correct (if confusing) but the test itself just matched the buggy behavior. =[ llvm-svn: 307764 --- llvm/lib/Analysis/CGSCCPassManager.cpp | 2 +- llvm/unittests/Analysis/CGSCCPassManagerTest.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/lib/Analysis/CGSCCPassManager.cpp b/llvm/lib/Analysis/CGSCCPassManager.cpp index 9db1e95..3ddefc6 100644 --- a/llvm/lib/Analysis/CGSCCPassManager.cpp +++ b/llvm/lib/Analysis/CGSCCPassManager.cpp @@ -373,7 +373,7 @@ incorporateNewSCCRange(const SCCRangeT &NewSCCRange, LazyCallGraph &G, // Ensure new SCCs' function analyses are updated. if (NeedFAMProxy) - updateNewSCCFunctionAnalyses(*C, G, AM); + updateNewSCCFunctionAnalyses(NewC, G, AM); // Also propagate a normal invalidation to the new SCC as only the current // will get one from the pass manager infrastructure. diff --git a/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp b/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp index 1e262683..d46d953 100644 --- a/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp +++ b/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp @@ -1261,12 +1261,12 @@ TEST_F(CGSCCPassManagerTest, TestAnalysisInvalidationCGSCCUpdate) { // split their SCCs. Then we re-run over the whole module. Then we re-run // over three functions merged back into a single SCC, and then over the // whole module again. - EXPECT_EQ(6 + 2 + 6 + 3 + 6, FunctionAnalysisRuns); + EXPECT_EQ(6 + 3 + 6 + 3 + 6, FunctionAnalysisRuns); - // Re run the function analysis twice over the entire module, and then re-run - // it over the `(h3, h1, h2)` SCC due to invalidation. Then we re-un over - // three functions merged back into a single SCC, and then over the whole - // module. - EXPECT_EQ(6 + 2 + 6 + 3 + 6, IndirectFunctionAnalysisRuns); + // Re run the function analysis over the entire module, and then re-run it + // over the `(h3, h1, h2)` SCC due to invalidation. Then we re-run it over + // the entire module, then the three functions merged back into a single SCC, + // and then over the whole module. + EXPECT_EQ(6 + 3 + 6 + 3 + 6, IndirectFunctionAnalysisRuns); } } -- 2.7.4