From 6cb647873930adc8ec596dd62416eed147b4375b Mon Sep 17 00:00:00 2001 From: David Green Date: Wed, 15 Aug 2018 10:59:41 +0000 Subject: [PATCH] [UnJ] Rename hasInvariantIterationCount to hasIterationCountInvariantInParent NFC This hopefully describes the API of the function more precisely. llvm-svn: 339762 --- llvm/include/llvm/Transforms/Utils/LoopUtils.h | 2 +- llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp | 2 +- llvm/lib/Transforms/Utils/LoopUtils.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/Transforms/Utils/LoopUtils.h b/llvm/include/llvm/Transforms/Utils/LoopUtils.h index a9193c7b7705..0d3688b52e08 100644 --- a/llvm/include/llvm/Transforms/Utils/LoopUtils.h +++ b/llvm/include/llvm/Transforms/Utils/LoopUtils.h @@ -492,7 +492,7 @@ Optional getLoopEstimatedTripCount(Loop *L); /// Check inner loop (L) backedge count is known to be invariant on all iterations /// of its outer loop. If the loop has no parent, this is trivially true. -bool hasInvariantIterationCount(Loop *L, ScalarEvolution &SE); +bool hasIterationCountInvariantInParent(Loop *L, ScalarEvolution &SE); /// Helper to consistently add the set of standard passes to a loop pass's \c /// AnalysisUsage. diff --git a/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp b/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp index 1a05bf4775bb..1ce2f8444896 100644 --- a/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp @@ -754,7 +754,7 @@ bool llvm::isSafeToUnrollAndJam(Loop *L, ScalarEvolution &SE, DominatorTree &DT, // Check inner loop backedge count is consistent on all iterations of the // outer loop - if (!hasInvariantIterationCount(SubLoop, SE)) { + if (!hasIterationCountInvariantInParent(SubLoop, SE)) { LLVM_DEBUG(dbgs() << "Won't unroll-and-jam; Inner loop iteration count is " "not consistent on each iteration\n"); return false; diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index e9db4725c781..3560a49c709e 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -1521,8 +1521,8 @@ Optional llvm::getLoopEstimatedTripCount(Loop *L) { return (FalseVal + (TrueVal / 2)) / TrueVal; } -bool llvm::hasInvariantIterationCount(Loop *InnerLoop, - ScalarEvolution &SE) { +bool llvm::hasIterationCountInvariantInParent(Loop *InnerLoop, + ScalarEvolution &SE) { Loop *OuterL = InnerLoop->getParentLoop(); if (!OuterL) return true;