From 14706f93f8db72b50a6df657e00da8c776b3b848 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Fri, 13 Feb 2015 00:00:24 +0000 Subject: [PATCH] [unroll] Update the new analysis logic from r228265 to use modern coding conventions for function names consistently. Some were already using this but not all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228987 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopUnrollPass.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/Transforms/Scalar/LoopUnrollPass.cpp b/lib/Transforms/Scalar/LoopUnrollPass.cpp index f691beb7219..3065b52cef1 100644 --- a/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -252,7 +252,7 @@ Pass *llvm::createSimpleLoopUnrollPass() { return llvm::createLoopUnrollPass(-1, -1, 0, 0); } -static bool IsLoadFromConstantInitializer(Value *V) { +static bool isLoadFromConstantInitializer(Value *V) { if (GlobalVariable *GV = dyn_cast(V)) if (GV->isConstant() && GV->hasDefinitiveInitializer()) return GV->getInitializer(); @@ -277,7 +277,7 @@ struct FindConstantPointers { // global (in which case we can eliminate the load), or not. BaseAddress = SC->getValue(); LoadCanBeConstantFolded = - IndexIsConstant && IsLoadFromConstantInitializer(BaseAddress); + IndexIsConstant && isLoadFromConstantInitializer(BaseAddress); return false; } if (isa(S)) @@ -429,7 +429,7 @@ public: // unrolling, would have a constant address and it will point to a known // constant initializer, record its base address for future use. It is used // when we estimate number of potentially simplified instructions. - void FindConstFoldableLoads() { + void findConstFoldableLoads() { for (auto BB : L->getBlocks()) { for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) { if (LoadInst *LI = dyn_cast(I)) { @@ -452,7 +452,7 @@ public: // estimate number of optimized instructions after substituting the concrete // values for the given Iteration. // Fill in SimplifiedInsns map for future use in DCE-estimation. - unsigned EstimateNumberOfSimplifiedInsns(unsigned Iteration) { + unsigned estimateNumberOfSimplifiedInsns(unsigned Iteration) { SmallVector Worklist; SimplifiedValues.clear(); CountedInsns.clear(); @@ -496,7 +496,7 @@ public: // Given a list of potentially simplifed instructions, estimate number of // instructions that would become dead if we do perform the simplification. - unsigned EstimateNumberOfDeadInsns() { + unsigned estimateNumberOfDeadInsns() { NumberOfOptimizedInstructions = 0; SmallVector Worklist; DenseMap DeadInstructions; @@ -545,14 +545,14 @@ public: // This routine estimates this optimization effect and returns the number of // instructions, that potentially might be optimized away. static unsigned -ApproximateNumberOfOptimizedInstructions(const Loop *L, ScalarEvolution &SE, +approximateNumberOfOptimizedInstructions(const Loop *L, ScalarEvolution &SE, unsigned TripCount, const TargetTransformInfo &TTI) { if (!TripCount) return 0; UnrollAnalyzer UA(L, TripCount, SE, TTI); - UA.FindConstFoldableLoads(); + UA.findConstFoldableLoads(); // Estimate number of instructions, that could be simplified if we replace a // load with the corresponding constant. Since the same load will take @@ -563,8 +563,8 @@ ApproximateNumberOfOptimizedInstructions(const Loop *L, ScalarEvolution &SE, std::min(UnrollMaxIterationsCountToAnalyze, TripCount); unsigned NumberOfOptimizedInstructions = 0; for (unsigned i = 0; i < IterationsNumberForEstimate; ++i) { - NumberOfOptimizedInstructions += UA.EstimateNumberOfSimplifiedInsns(i); - NumberOfOptimizedInstructions += UA.EstimateNumberOfDeadInsns(); + NumberOfOptimizedInstructions += UA.estimateNumberOfSimplifiedInsns(i); + NumberOfOptimizedInstructions += UA.estimateNumberOfDeadInsns(); } NumberOfOptimizedInstructions *= TripCount / IterationsNumberForEstimate; @@ -776,7 +776,7 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) { } unsigned NumberOfOptimizedInstructions = - ApproximateNumberOfOptimizedInstructions(L, *SE, TripCount, TTI); + approximateNumberOfOptimizedInstructions(L, *SE, TripCount, TTI); DEBUG(dbgs() << " Complete unrolling could save: " << NumberOfOptimizedInstructions << "\n"); -- 2.34.1