diff options
| author | Max Kazantsev <max.kazantsev@azul.com> | 2019-02-04 10:20:51 +0000 |
|---|---|---|
| committer | Max Kazantsev <max.kazantsev@azul.com> | 2019-02-04 10:20:51 +0000 |
| commit | 13ab5cbb6476e068deed6b9d2fb6578222d37124 (patch) | |
| tree | 9cea920f558033e08b4747dffb8c759cd9768794 | |
| parent | 20bef459fca6069d5c01d38c5eebf2582930c96f (diff) | |
| download | bcm5719-llvm-13ab5cbb6476e068deed6b9d2fb6578222d37124.tar.gz bcm5719-llvm-13ab5cbb6476e068deed6b9d2fb6578222d37124.zip | |
[NFC] Remove redundant parameters for better readability
llvm-svn: 353034
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GuardWidening.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Scalar/GuardWidening.cpp b/llvm/lib/Transforms/Scalar/GuardWidening.cpp index e7da37ebf8c..10c2e3bf56f 100644 --- a/llvm/lib/Transforms/Scalar/GuardWidening.cpp +++ b/llvm/lib/Transforms/Scalar/GuardWidening.cpp @@ -162,13 +162,10 @@ class GuardWideningImpl { static StringRef scoreTypeToString(WideningScore WS); /// Compute the score for widening the condition in \p DominatedGuard - /// (contained in \p DominatedGuardLoop) into \p DominatingGuard (contained in - /// \p DominatingGuardLoop). If \p InvertCond is set, then we widen the + /// into \p DominatingGuard. If \p InvertCond is set, then we widen the /// inverted condition of the dominating guard. WideningScore computeWideningScore(Instruction *DominatedGuard, - Loop *DominatedGuardLoop, Instruction *DominatingGuard, - Loop *DominatingGuardLoop, bool InvertCond); /// Helper to check if \p V can be hoisted to \p InsertPos. @@ -349,7 +346,6 @@ bool GuardWideningImpl::eliminateGuardViaWidening( Instruction *BestSoFar = nullptr; auto BestScoreSoFar = WS_IllegalOrNegative; - auto *GuardInstLoop = LI.getLoopFor(GuardInst->getParent()); // In the set of dominating guards, find the one we can merge GuardInst with // for the most profit. @@ -357,7 +353,6 @@ bool GuardWideningImpl::eliminateGuardViaWidening( auto *CurBB = DFSI.getPath(i)->getBlock(); if (!BlockFilter(CurBB)) break; - auto *CurLoop = LI.getLoopFor(CurBB); assert(GuardsInBlock.count(CurBB) && "Must have been populated by now!"); const auto &GuardsInCurBB = GuardsInBlock.find(CurBB)->second; @@ -390,9 +385,7 @@ bool GuardWideningImpl::eliminateGuardViaWidening( } for (auto *Candidate : make_range(I, E)) { - auto Score = - computeWideningScore(GuardInst, GuardInstLoop, Candidate, CurLoop, - InvertCondition); + auto Score = computeWideningScore(GuardInst, Candidate, InvertCondition); LLVM_DEBUG(dbgs() << "Score between " << *getCondition(GuardInst) << " and " << *getCondition(Candidate) << " is " << scoreTypeToString(Score) << "\n"); @@ -424,9 +417,12 @@ bool GuardWideningImpl::eliminateGuardViaWidening( return true; } -GuardWideningImpl::WideningScore GuardWideningImpl::computeWideningScore( - Instruction *DominatedGuard, Loop *DominatedGuardLoop, - Instruction *DominatingGuard, Loop *DominatingGuardLoop, bool InvertCond) { +GuardWideningImpl::WideningScore +GuardWideningImpl::computeWideningScore(Instruction *DominatedGuard, + Instruction *DominatingGuard, + bool InvertCond) { + Loop *DominatedGuardLoop = LI.getLoopFor(DominatedGuard->getParent()); + Loop *DominatingGuardLoop = LI.getLoopFor(DominatingGuard->getParent()); bool HoistingOutOfLoop = false; if (DominatingGuardLoop != DominatedGuardLoop) { |

