From 818b1ab84e7be3088ade938286132cda663a6573 Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Mon, 19 Sep 2022 14:05:42 +0700 Subject: [PATCH] [SCEV][NFC] Remove unused parameter from forgetLoopDispositions Let's be honest about it, we don't drop loop dispositions for particular loops. Remove the parameter that misleadingly makes it apparent that we do. --- llvm/include/llvm/Analysis/ScalarEvolution.h | 2 +- llvm/lib/Analysis/ScalarEvolution.cpp | 4 +--- llvm/lib/Transforms/Scalar/LICM.cpp | 2 +- llvm/lib/Transforms/Scalar/LoopDeletion.cpp | 2 +- llvm/lib/Transforms/Scalar/LoopSink.cpp | 2 +- llvm/lib/Transforms/Utils/LoopSimplify.cpp | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h index c258837..1de1296 100644 --- a/llvm/include/llvm/Analysis/ScalarEvolution.h +++ b/llvm/include/llvm/Analysis/ScalarEvolution.h @@ -937,7 +937,7 @@ public: /// /// We don't have a way to invalidate per-loop dispositions. Clear and /// recompute is simpler. - void forgetLoopDispositions(const Loop *L); + void forgetLoopDispositions(); /// Determine the minimum number of zero bits that S is guaranteed to end in /// (at every loop iteration). It is, at the same time, the minimum number diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index f829aaa..4bf975f 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -8382,9 +8382,7 @@ void ScalarEvolution::forgetValue(Value *V) { forgetMemoizedResults(ToForget); } -void ScalarEvolution::forgetLoopDispositions(const Loop *L) { - LoopDispositions.clear(); -} +void ScalarEvolution::forgetLoopDispositions() { LoopDispositions.clear(); } /// Get the exact loop backedge taken count considering all loop exits. A /// computable result can only be returned for loops with all exiting blocks diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 671c011..120dd2f 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -510,7 +510,7 @@ bool LoopInvariantCodeMotion::runOnLoop( MSSA->verifyMemorySSA(); if (Changed && SE) - SE->forgetLoopDispositions(L); + SE->forgetLoopDispositions(); return Changed; } diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp index bf5c1f4..1a538dd 100644 --- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp @@ -98,7 +98,7 @@ static bool isLoopDead(Loop *L, ScalarEvolution &SE, } if (Changed) - SE.forgetLoopDispositions(L); + SE.forgetLoopDispositions(); if (!AllEntriesInvariant || !AllOutgoingValuesSame) return false; diff --git a/llvm/lib/Transforms/Scalar/LoopSink.cpp b/llvm/lib/Transforms/Scalar/LoopSink.cpp index 250eab8..131af32 100644 --- a/llvm/lib/Transforms/Scalar/LoopSink.cpp +++ b/llvm/lib/Transforms/Scalar/LoopSink.cpp @@ -317,7 +317,7 @@ static bool sinkLoopInvariantInstructions(Loop &L, AAResults &AA, LoopInfo &LI, } if (Changed && SE) - SE->forgetLoopDispositions(&L); + SE->forgetLoopDispositions(); return Changed; } diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 542094f..15f9a96 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -660,7 +660,7 @@ ReprocessLoop: // The loop disposition of all SCEV expressions that depend on any // hoisted values have also changed. if (SE) - SE->forgetLoopDispositions(L); + SE->forgetLoopDispositions(); } if (!AllInvariant) continue; -- 2.7.4