diff options
author | Devang Patel <dpatel@apple.com> | 2007-08-24 05:21:13 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-08-24 05:21:13 +0000 |
commit | 7237d1167a0d79a9eb1662706db42f3af996f841 (patch) | |
tree | bc7245b3829ee78c0f6f7302e352cc404992445e /lib/Transforms | |
parent | d3b51fd17024569cc53ae02b9a4f80857930e08b (diff) | |
download | external_llvm-7237d1167a0d79a9eb1662706db42f3af996f841.zip external_llvm-7237d1167a0d79a9eb1662706db42f3af996f841.tar.gz external_llvm-7237d1167a0d79a9eb1662706db42f3af996f841.tar.bz2 |
Remove incomplete cost analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41354 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/LoopIndexSplit.cpp | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp index de8b08e..854b172 100644 --- a/lib/Transforms/Scalar/LoopIndexSplit.cpp +++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp @@ -103,9 +103,6 @@ namespace { /// DeadBB. LiveBB dominates split conidition's other branch. void removeBlocks(BasicBlock *DeadBB, Loop *LP, BasicBlock *LiveBB); - /// Find cost of spliting loop L. - unsigned findSplitCost(Loop *L, SplitInfo &SD); - /// safeSplitCondition - Return true if it is possible to /// split loop using given split condition. bool safeSplitCondition(SplitInfo &SD); @@ -202,25 +199,10 @@ bool LoopIndexSplit::runOnLoop(Loop *IncomingLoop, LPPassManager &LPM_Ref) { ++SI; } - unsigned MaxCost = 99; - unsigned Index = 0; - unsigned MostProfitableSDIndex = 0; - for (SmallVector<SplitInfo, 4>::iterator SI = SplitData.begin(), - E = SplitData.end(); SI != E; ++SI, ++Index) { - SplitInfo SD = *SI; - - // ICM_EQs are already handled above. - assert (SD.SplitCondition->getPredicate() != ICmpInst::ICMP_EQ && - "Unexpected split condition predicate"); - - unsigned Cost = findSplitCost(L, SD); - if (Cost < MaxCost) - MostProfitableSDIndex = Index; - } - // Split most profitiable condition. - if (!SplitData.empty()) - Changed = splitLoop(SplitData[MostProfitableSDIndex]); + // FIXME : Implement cost analysis. + unsigned MostProfitableSDIndex = 0; + Changed = splitLoop(SplitData[MostProfitableSDIndex]); if (Changed) ++NumIndexSplit; @@ -595,25 +577,6 @@ bool LoopIndexSplit::safeExitingBlock(SplitInfo &SD, return true; } -/// Find cost of spliting loop L. Cost is measured in terms of size growth. -/// Size is growth is calculated based on amount of code duplicated in second -/// loop. -unsigned LoopIndexSplit::findSplitCost(Loop *L, SplitInfo &SD) { - - unsigned Cost = 0; - BasicBlock *SDBlock = SD.SplitCondition->getParent(); - for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); - I != E; ++I) { - BasicBlock *BB = *I; - // If a block is not dominated by split condition block then - // it must be duplicated in both loops. - if (!DT->dominates(SDBlock, BB)) - Cost += BB->size(); - } - - return Cost; -} - /// removeBlocks - Remove basic block DeadBB and all blocks dominated by DeadBB. /// This routine is used to remove split condition's dead branch, dominated by /// DeadBB. LiveBB dominates split conidition's other branch. |