From 97789b71178253b7869c20bc1636bc67ce7a24e0 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 --- include/llvm/Transforms/Utils/LoopUtils.h | 2 +- lib/Transforms/Utils/LoopUnrollAndJam.cpp | 2 +- lib/Transforms/Utils/LoopUtils.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/llvm/Transforms/Utils/LoopUtils.h b/include/llvm/Transforms/Utils/LoopUtils.h index a9193c7b770..0d3688b52e0 100644 --- a/include/llvm/Transforms/Utils/LoopUtils.h +++ b/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/lib/Transforms/Utils/LoopUnrollAndJam.cpp b/lib/Transforms/Utils/LoopUnrollAndJam.cpp index 1a05bf4775b..1ce2f844489 100644 --- a/lib/Transforms/Utils/LoopUnrollAndJam.cpp +++ b/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/lib/Transforms/Utils/LoopUtils.cpp b/lib/Transforms/Utils/LoopUtils.cpp index e9db4725c78..3560a49c709 100644 --- a/lib/Transforms/Utils/LoopUtils.cpp +++ b/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;