From 7a1762f19024916a51679bc934fd8f68c586557d Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Thu, 6 May 2021 16:30:39 -0700 Subject: [PATCH] [NewPM] Don't mark AA analyses as preserved Currently all AA analyses marked as preserved are stateless, not taking into account their dependent analyses. So there's no need to mark them as preserved, they won't be invalidated unless their analyses are. SCEVAAResults was the one exception to this, it was treated like a typical analysis result. Make it like the others and don't invalidate unless SCEV is invalidated. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D102032 --- include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h | 3 +++ lib/Analysis/LoopAnalysisManager.cpp | 6 ------ lib/Analysis/ScalarEvolutionAliasAnalysis.cpp | 8 ++++++++ lib/CodeGen/ReplaceWithVeclib.cpp | 2 -- .../AggressiveInstCombine/AggressiveInstCombine.cpp | 2 -- lib/Transforms/InstCombine/InstructionCombining.cpp | 3 --- lib/Transforms/Instrumentation/ControlHeightReduction.cpp | 5 ++--- lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp | 1 - lib/Transforms/Scalar/ADCE.cpp | 1 - lib/Transforms/Scalar/AlignmentFromAssumptions.cpp | 2 -- lib/Transforms/Scalar/BDCE.cpp | 1 - lib/Transforms/Scalar/ConstraintElimination.cpp | 1 - lib/Transforms/Scalar/CorrelatedValuePropagation.cpp | 1 - lib/Transforms/Scalar/DeadStoreElimination.cpp | 1 - lib/Transforms/Scalar/DivRemPairs.cpp | 1 - lib/Transforms/Scalar/EarlyCSE.cpp | 1 - lib/Transforms/Scalar/Float2Int.cpp | 1 - lib/Transforms/Scalar/GVN.cpp | 1 - lib/Transforms/Scalar/GVNHoist.cpp | 1 - lib/Transforms/Scalar/GVNSink.cpp | 5 +---- lib/Transforms/Scalar/JumpThreading.cpp | 1 - lib/Transforms/Scalar/LoopDistribute.cpp | 1 - lib/Transforms/Scalar/LoopPassManager.cpp | 6 ------ lib/Transforms/Scalar/LowerConstantIntrinsics.cpp | 1 - lib/Transforms/Scalar/MemCpyOptimizer.cpp | 1 - lib/Transforms/Scalar/MergeICmps.cpp | 1 - lib/Transforms/Scalar/MergedLoadStoreMotion.cpp | 1 - lib/Transforms/Scalar/NewGVN.cpp | 1 - lib/Transforms/Scalar/Reassociate.cpp | 3 --- lib/Transforms/Scalar/SCCP.cpp | 1 - lib/Transforms/Scalar/SROA.cpp | 1 - lib/Transforms/Scalar/SimplifyCFGPass.cpp | 1 - lib/Transforms/Scalar/SpeculativeExecution.cpp | 1 - lib/Transforms/Scalar/TailRecursionElimination.cpp | 1 - lib/Transforms/Utils/LCSSA.cpp | 3 --- lib/Transforms/Utils/LibCallsShrinkWrap.cpp | 1 - lib/Transforms/Utils/LoopSimplify.cpp | 3 --- lib/Transforms/Vectorize/LoopVectorize.cpp | 2 -- lib/Transforms/Vectorize/SLPVectorizer.cpp | 2 -- lib/Transforms/Vectorize/VectorCombine.cpp | 3 --- unittests/Transforms/Scalar/LoopPassManagerTest.cpp | 4 ---- 41 files changed, 14 insertions(+), 72 deletions(-) diff --git a/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h b/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h index 98d53237d4a..20acb407ead 100644 --- a/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h +++ b/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h @@ -33,6 +33,9 @@ public: AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI); + bool invalidate(Function &F, const PreservedAnalyses &PA, + FunctionAnalysisManager::Invalidator &Inv); + private: Value *GetBaseValue(const SCEV *S); }; diff --git a/lib/Analysis/LoopAnalysisManager.cpp b/lib/Analysis/LoopAnalysisManager.cpp index 4ad5641da14..4d6f8a64329 100644 --- a/lib/Analysis/LoopAnalysisManager.cpp +++ b/lib/Analysis/LoopAnalysisManager.cpp @@ -143,11 +143,5 @@ PreservedAnalyses llvm::getLoopPassPreservedAnalyses() { PA.preserve(); PA.preserve(); PA.preserve(); - // FIXME: What we really want to do here is preserve an AA category, but that - // concept doesn't exist yet. - PA.preserve(); - PA.preserve(); - PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp b/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp index f30497a3979..f447f5c13b8 100644 --- a/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp +++ b/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp @@ -19,6 +19,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h" +#include "llvm/Analysis/ScalarEvolution.h" #include "llvm/InitializePasses.h" using namespace llvm; @@ -117,6 +118,13 @@ Value *SCEVAAResult::GetBaseValue(const SCEV *S) { return nullptr; } +bool SCEVAAResult::invalidate(Function &Fn, const PreservedAnalyses &PA, + FunctionAnalysisManager::Invalidator &Inv) { + // We don't care if this analysis itself is preserved, it has no state. But + // we need to check that the analyses it depends on have been. + return Inv.invalidate(Fn, PA); +} + AnalysisKey SCEVAA::Key; SCEVAAResult SCEVAA::run(Function &F, FunctionAnalysisManager &AM) { diff --git a/lib/CodeGen/ReplaceWithVeclib.cpp b/lib/CodeGen/ReplaceWithVeclib.cpp index d823a0a37e4..139860bcbf1 100644 --- a/lib/CodeGen/ReplaceWithVeclib.cpp +++ b/lib/CodeGen/ReplaceWithVeclib.cpp @@ -205,11 +205,9 @@ PreservedAnalyses ReplaceWithVeclib::run(Function &F, PA.preserveSet(); PA.preserve(); PA.preserve(); - PA.preserve(); PA.preserve(); PA.preserve(); PA.preserve(); - PA.preserve(); return PA; } else { // The pass did not replace any calls, hence it preserves all analyses. diff --git a/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp b/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp index a7ae10d156d..85abbf6d86e 100644 --- a/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp +++ b/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp @@ -431,8 +431,6 @@ PreservedAnalyses AggressiveInstCombinePass::run(Function &F, // Mark all the analyses that instcombine updates as preserved. PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index e5f01ae59f7..9734244dab5 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -4045,9 +4045,6 @@ PreservedAnalyses InstCombinePass::run(Function &F, // Mark all the analyses that instcombine updates as preserved. PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); - PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Instrumentation/ControlHeightReduction.cpp b/lib/Transforms/Instrumentation/ControlHeightReduction.cpp index 927c34180db..34202562c8b 100644 --- a/lib/Transforms/Instrumentation/ControlHeightReduction.cpp +++ b/lib/Transforms/Instrumentation/ControlHeightReduction.cpp @@ -27,6 +27,7 @@ #include "llvm/IR/Dominators.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/MDBuilder.h" +#include "llvm/IR/PassManager.h" #include "llvm/InitializePasses.h" #include "llvm/Support/BranchProbability.h" #include "llvm/Support/CommandLine.h" @@ -2095,9 +2096,7 @@ PreservedAnalyses ControlHeightReductionPass::run( bool Changed = CHR(F, BFI, DT, PSI, RI, ORE).run(); if (!Changed) return PreservedAnalyses::all(); - auto PA = PreservedAnalyses(); - PA.preserve(); - return PA; + return PreservedAnalyses::none(); } } // namespace llvm diff --git a/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp b/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp index 1af891c51bc..d4b78f2c14b 100644 --- a/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp +++ b/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp @@ -541,7 +541,6 @@ PreservedAnalyses PGOMemOPSizeOpt::run(Function &F, if (!Changed) return PreservedAnalyses::all(); auto PA = PreservedAnalyses(); - PA.preserve(); PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index 6a31e71d80d..09f7ccb1bec 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/lib/Transforms/Scalar/ADCE.cpp @@ -700,7 +700,6 @@ PreservedAnalyses ADCEPass::run(Function &F, FunctionAnalysisManager &FAM) { PA.preserve(); PA.preserve(); } - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp index 45e3b7b05a0..b0e60aa5ae5 100644 --- a/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp +++ b/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp @@ -352,8 +352,6 @@ AlignmentFromAssumptionsPass::run(Function &F, FunctionAnalysisManager &AM) { PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/BDCE.cpp b/lib/Transforms/Scalar/BDCE.cpp index 767c7656dcf..c06125788f3 100644 --- a/lib/Transforms/Scalar/BDCE.cpp +++ b/lib/Transforms/Scalar/BDCE.cpp @@ -170,7 +170,6 @@ PreservedAnalyses BDCEPass::run(Function &F, FunctionAnalysisManager &AM) { PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/ConstraintElimination.cpp b/lib/Transforms/Scalar/ConstraintElimination.cpp index 16cde39ecff..efd1c025d0c 100644 --- a/lib/Transforms/Scalar/ConstraintElimination.cpp +++ b/lib/Transforms/Scalar/ConstraintElimination.cpp @@ -475,7 +475,6 @@ PreservedAnalyses ConstraintEliminationPass::run(Function &F, PreservedAnalyses PA; PA.preserve(); - PA.preserve(); PA.preserveSet(); return PA; } diff --git a/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp index 2f21460e1e9..73ac0933c91 100644 --- a/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp +++ b/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp @@ -1118,7 +1118,6 @@ CorrelatedValuePropagationPass::run(Function &F, FunctionAnalysisManager &AM) { if (!Changed) { PA = PreservedAnalyses::all(); } else { - PA.preserve(); PA.preserve(); PA.preserve(); } diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index 201a60801dd..94f3e0d3464 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -2028,7 +2028,6 @@ PreservedAnalyses DSEPass::run(Function &F, FunctionAnalysisManager &AM) { PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/DivRemPairs.cpp b/lib/Transforms/Scalar/DivRemPairs.cpp index 3c6c444d664..574640d978a 100644 --- a/lib/Transforms/Scalar/DivRemPairs.cpp +++ b/lib/Transforms/Scalar/DivRemPairs.cpp @@ -394,6 +394,5 @@ PreservedAnalyses DivRemPairsPass::run(Function &F, // TODO: This pass just hoists/replaces math ops - all analyses are preserved? PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/EarlyCSE.cpp b/lib/Transforms/Scalar/EarlyCSE.cpp index 51ed5ae3a7d..3905ceb754d 100644 --- a/lib/Transforms/Scalar/EarlyCSE.cpp +++ b/lib/Transforms/Scalar/EarlyCSE.cpp @@ -1616,7 +1616,6 @@ PreservedAnalyses EarlyCSEPass::run(Function &F, PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); if (UseMemorySSA) PA.preserve(); return PA; diff --git a/lib/Transforms/Scalar/Float2Int.cpp b/lib/Transforms/Scalar/Float2Int.cpp index b6d82685e88..f1e6eaaf12e 100644 --- a/lib/Transforms/Scalar/Float2Int.cpp +++ b/lib/Transforms/Scalar/Float2Int.cpp @@ -544,7 +544,6 @@ PreservedAnalyses Float2IntPass::run(Function &F, FunctionAnalysisManager &AM) { PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); return PA; } } // End namespace llvm diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index df1bf1dcda7..b4714d9cf11 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -677,7 +677,6 @@ PreservedAnalyses GVN::run(Function &F, FunctionAnalysisManager &AM) { return PreservedAnalyses::all(); PreservedAnalyses PA; PA.preserve(); - PA.preserve(); PA.preserve(); if (MSSA) PA.preserve(); diff --git a/lib/Transforms/Scalar/GVNHoist.cpp b/lib/Transforms/Scalar/GVNHoist.cpp index 8d0bd567496..790d71992da 100644 --- a/lib/Transforms/Scalar/GVNHoist.cpp +++ b/lib/Transforms/Scalar/GVNHoist.cpp @@ -1243,7 +1243,6 @@ PreservedAnalyses GVNHoistPass::run(Function &F, FunctionAnalysisManager &AM) { PreservedAnalyses PA; PA.preserve(); PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/GVNSink.cpp b/lib/Transforms/Scalar/GVNSink.cpp index aef927ab655..e612a82fc89 100644 --- a/lib/Transforms/Scalar/GVNSink.cpp +++ b/lib/Transforms/Scalar/GVNSink.cpp @@ -912,10 +912,7 @@ PreservedAnalyses GVNSinkPass::run(Function &F, FunctionAnalysisManager &AM) { GVNSink G; if (!G.run(F)) return PreservedAnalyses::all(); - - PreservedAnalyses PA; - PA.preserve(); - return PA; + return PreservedAnalyses::none(); } char GVNSinkLegacyPass::ID = 0; diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index fab287e29d0..d299c40330f 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/lib/Transforms/Scalar/JumpThreading.cpp @@ -371,7 +371,6 @@ PreservedAnalyses JumpThreadingPass::run(Function &F, if (!Changed) return PreservedAnalyses::all(); PreservedAnalyses PA; - PA.preserve(); PA.preserve(); PA.preserve(); return PA; diff --git a/lib/Transforms/Scalar/LoopDistribute.cpp b/lib/Transforms/Scalar/LoopDistribute.cpp index 1bd2529891b..bac3dc0f3fb 100644 --- a/lib/Transforms/Scalar/LoopDistribute.cpp +++ b/lib/Transforms/Scalar/LoopDistribute.cpp @@ -1068,7 +1068,6 @@ PreservedAnalyses LoopDistributePass::run(Function &F, PreservedAnalyses PA; PA.preserve(); PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/LoopPassManager.cpp b/lib/Transforms/Scalar/LoopPassManager.cpp index 5e03bdb0ae4..f4fce487133 100644 --- a/lib/Transforms/Scalar/LoopPassManager.cpp +++ b/lib/Transforms/Scalar/LoopPassManager.cpp @@ -327,12 +327,6 @@ PreservedAnalyses FunctionToLoopPassAdaptor::run(Function &F, PA.preserve(); if (UseMemorySSA) PA.preserve(); - // FIXME: What we really want to do here is preserve an AA category, but - // that concept doesn't exist yet. - PA.preserve(); - PA.preserve(); - PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp b/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp index 2ba84440cb7..bd300198836 100644 --- a/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp +++ b/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp @@ -151,7 +151,6 @@ LowerConstantIntrinsicsPass::run(Function &F, FunctionAnalysisManager &AM) { if (lowerConstantIntrinsics(F, AM.getCachedResult(F), AM.getCachedResult(F))) { PreservedAnalyses PA; - PA.preserve(); PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp index 29f43f1ac30..6cf317a1c47 100644 --- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp +++ b/lib/Transforms/Scalar/MemCpyOptimizer.cpp @@ -1724,7 +1724,6 @@ PreservedAnalyses MemCpyOptPass::run(Function &F, FunctionAnalysisManager &AM) { PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); if (MD) PA.preserve(); if (MSSA) diff --git a/lib/Transforms/Scalar/MergeICmps.cpp b/lib/Transforms/Scalar/MergeICmps.cpp index 0c27a609d96..0327652ab92 100644 --- a/lib/Transforms/Scalar/MergeICmps.cpp +++ b/lib/Transforms/Scalar/MergeICmps.cpp @@ -938,7 +938,6 @@ PreservedAnalyses MergeICmpsPass::run(Function &F, if (!MadeChanges) return PreservedAnalyses::all(); PreservedAnalyses PA; - PA.preserve(); PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp b/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp index 69aa0cebe17..033fc168a67 100644 --- a/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp +++ b/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp @@ -418,6 +418,5 @@ MergedLoadStoreMotionPass::run(Function &F, FunctionAnalysisManager &AM) { PreservedAnalyses PA; if (!Options.SplitFooterBB) PA.preserveSet(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/NewGVN.cpp b/lib/Transforms/Scalar/NewGVN.cpp index 5408d0df2f7..a137d13c6ea 100644 --- a/lib/Transforms/Scalar/NewGVN.cpp +++ b/lib/Transforms/Scalar/NewGVN.cpp @@ -4222,6 +4222,5 @@ PreservedAnalyses NewGVNPass::run(Function &F, AnalysisManager &AM) { return PreservedAnalyses::all(); PreservedAnalyses PA; PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 2c1cf19b4e0..888edc4d69a 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -2568,9 +2568,6 @@ PreservedAnalyses ReassociatePass::run(Function &F, FunctionAnalysisManager &) { if (MadeChange) { PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); - PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 76a738444b8..2d719e4897e 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -242,7 +242,6 @@ PreservedAnalyses SCCPPass::run(Function &F, FunctionAnalysisManager &AM) { return PreservedAnalyses::all(); auto PA = PreservedAnalyses(); - PA.preserve(); PA.preserveSet(); return PA; } diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp index 66a29782039..b76f2288c64 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/lib/Transforms/Scalar/SROA.cpp @@ -4780,7 +4780,6 @@ PreservedAnalyses SROA::runImpl(Function &F, DominatorTree &RunDT, PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/lib/Transforms/Scalar/SimplifyCFGPass.cpp index f0702e00e38..97ccfc3b078 100644 --- a/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -323,7 +323,6 @@ PreservedAnalyses SimplifyCFGPass::run(Function &F, PreservedAnalyses PA; if (RequireAndPreserveDomTree) PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Scalar/SpeculativeExecution.cpp b/lib/Transforms/Scalar/SpeculativeExecution.cpp index 809e62b330d..dfa30418ea0 100644 --- a/lib/Transforms/Scalar/SpeculativeExecution.cpp +++ b/lib/Transforms/Scalar/SpeculativeExecution.cpp @@ -343,7 +343,6 @@ PreservedAnalyses SpeculativeExecutionPass::run(Function &F, if (!Changed) return PreservedAnalyses::all(); PreservedAnalyses PA; - PA.preserve(); PA.preserveSet(); return PA; } diff --git a/lib/Transforms/Scalar/TailRecursionElimination.cpp b/lib/Transforms/Scalar/TailRecursionElimination.cpp index 801c9ef68bb..6f52dae8613 100644 --- a/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -896,7 +896,6 @@ PreservedAnalyses TailCallElimPass::run(Function &F, if (!Changed) return PreservedAnalyses::all(); PreservedAnalyses PA; - PA.preserve(); PA.preserve(); PA.preserve(); return PA; diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp index 3bae480ae3a..277fd903e9a 100644 --- a/lib/Transforms/Utils/LCSSA.cpp +++ b/lib/Transforms/Utils/LCSSA.cpp @@ -503,9 +503,6 @@ PreservedAnalyses LCSSAPass::run(Function &F, FunctionAnalysisManager &AM) { PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); - PA.preserve(); - PA.preserve(); PA.preserve(); // BPI maps terminators to probabilities, since we don't modify the CFG, no // updates are needed to preserve it. diff --git a/lib/Transforms/Utils/LibCallsShrinkWrap.cpp b/lib/Transforms/Utils/LibCallsShrinkWrap.cpp index 4c52fac6f7c..7e5832148bc 100644 --- a/lib/Transforms/Utils/LibCallsShrinkWrap.cpp +++ b/lib/Transforms/Utils/LibCallsShrinkWrap.cpp @@ -555,7 +555,6 @@ PreservedAnalyses LibCallsShrinkWrapPass::run(Function &F, if (!runImpl(F, TLI, DT)) return PreservedAnalyses::all(); auto PA = PreservedAnalyses(); - PA.preserve(); PA.preserve(); return PA; } diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 6adfeaf4fd5..260ada85a1f 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -865,9 +865,6 @@ PreservedAnalyses LoopSimplifyPass::run(Function &F, PreservedAnalyses PA; PA.preserve(); PA.preserve(); - PA.preserve(); - PA.preserve(); - PA.preserve(); PA.preserve(); PA.preserve(); if (MSSAAnalysis) diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index cfa70aed15c..7eacfe45383 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -10283,8 +10283,6 @@ PreservedAnalyses LoopVectorizePass::run(Function &F, PA.preserve(); PA.preserve(); } - PA.preserve(); - PA.preserve(); if (!Result.MadeCFGChange) PA.preserveSet(); return PA; diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 89821d79458..e165c424bab 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -6339,8 +6339,6 @@ PreservedAnalyses SLPVectorizerPass::run(Function &F, FunctionAnalysisManager &A PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); - PA.preserve(); return PA; } diff --git a/lib/Transforms/Vectorize/VectorCombine.cpp b/lib/Transforms/Vectorize/VectorCombine.cpp index c254f612858..ed6709e1086 100644 --- a/lib/Transforms/Vectorize/VectorCombine.cpp +++ b/lib/Transforms/Vectorize/VectorCombine.cpp @@ -917,8 +917,5 @@ PreservedAnalyses VectorCombinePass::run(Function &F, return PreservedAnalyses::all(); PreservedAnalyses PA; PA.preserveSet(); - PA.preserve(); - PA.preserve(); - PA.preserve(); return PA; } diff --git a/unittests/Transforms/Scalar/LoopPassManagerTest.cpp b/unittests/Transforms/Scalar/LoopPassManagerTest.cpp index 646d1949ecc..db631c221e5 100644 --- a/unittests/Transforms/Scalar/LoopPassManagerTest.cpp +++ b/unittests/Transforms/Scalar/LoopPassManagerTest.cpp @@ -610,7 +610,6 @@ TEST_F(LoopPassManagerTest, InvalidationOfBundledAnalyses) { EXPECT_CALL(MFPHandle, run(HasName("f"), _)).WillOnce(InvokeWithoutArgs([] { auto PA = PreservedAnalyses::none(); - PA.preserve(); // Not preserving `DominatorTreeAnalysis`. PA.preserve(); PA.preserve(); @@ -626,7 +625,6 @@ TEST_F(LoopPassManagerTest, InvalidationOfBundledAnalyses) { EXPECT_CALL(MFPHandle, run(HasName("f"), _)).WillOnce(InvokeWithoutArgs([] { auto PA = PreservedAnalyses::none(); - PA.preserve(); PA.preserve(); // Not preserving the `LoopAnalysis`. PA.preserve(); @@ -642,7 +640,6 @@ TEST_F(LoopPassManagerTest, InvalidationOfBundledAnalyses) { EXPECT_CALL(MFPHandle, run(HasName("f"), _)).WillOnce(InvokeWithoutArgs([] { auto PA = PreservedAnalyses::none(); - PA.preserve(); PA.preserve(); PA.preserve(); // Not preserving the `LoopAnalysisManagerFunctionProxy`. @@ -658,7 +655,6 @@ TEST_F(LoopPassManagerTest, InvalidationOfBundledAnalyses) { EXPECT_CALL(MFPHandle, run(HasName("f"), _)).WillOnce(InvokeWithoutArgs([] { auto PA = PreservedAnalyses::none(); - PA.preserve(); PA.preserve(); PA.preserve(); PA.preserve();