blob: c64e22e9190306941f84c8da578ba6eefbfb3ef0 [file] [log] [blame]
Devang Patelbc5fe632007-08-07 00:25:56 +00001//===- LoopIndexSplit.cpp - Loop Index Splitting Pass ---------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Devang Patel and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file implements Loop Index Splitting Pass.
11//
12//===----------------------------------------------------------------------===//
13
14#define DEBUG_TYPE "loop-index-split"
15
Devang Patelbc5fe632007-08-07 00:25:56 +000016#include "llvm/Transforms/Scalar.h"
Devang Patel3719d4f2007-08-07 23:17:52 +000017#include "llvm/Function.h"
Devang Patelbc5fe632007-08-07 00:25:56 +000018#include "llvm/Analysis/LoopPass.h"
19#include "llvm/Analysis/ScalarEvolutionExpander.h"
Devang Patel95fd7172007-08-08 21:39:47 +000020#include "llvm/Analysis/Dominators.h"
Devang Patelbc5fe632007-08-07 00:25:56 +000021#include "llvm/Support/Compiler.h"
22#include "llvm/ADT/Statistic.h"
23
24using namespace llvm;
25
26STATISTIC(NumIndexSplit, "Number of loops index split");
27
28namespace {
29
30 class VISIBILITY_HIDDEN LoopIndexSplit : public LoopPass {
31
32 public:
33 static char ID; // Pass ID, replacement for typeid
34 LoopIndexSplit() : LoopPass((intptr_t)&ID) {}
35
36 // Index split Loop L. Return true if loop is split.
37 bool runOnLoop(Loop *L, LPPassManager &LPM);
38
39 void getAnalysisUsage(AnalysisUsage &AU) const {
40 AU.addRequired<ScalarEvolution>();
41 AU.addPreserved<ScalarEvolution>();
42 AU.addRequiredID(LCSSAID);
43 AU.addPreservedID(LCSSAID);
44 AU.addPreserved<LoopInfo>();
45 AU.addRequiredID(LoopSimplifyID);
46 AU.addPreservedID(LoopSimplifyID);
Devang Patel0aaeb172007-08-08 22:25:28 +000047 AU.addRequired<DominatorTree>();
Devang Patel95fd7172007-08-08 21:39:47 +000048 AU.addPreserved<DominatorTree>();
49 AU.addPreserved<DominanceFrontier>();
Devang Patelbc5fe632007-08-07 00:25:56 +000050 }
51
52 private:
Devang Patelc8dadbf2007-08-08 21:02:17 +000053
54 class SplitInfo {
55 public:
56 SplitInfo() : IndVar(NULL), SplitValue(NULL), ExitValue(NULL),
57 SplitCondition(NULL), ExitCondition(NULL) {}
58 // Induction variable whose range is being split by this transformation.
59 PHINode *IndVar;
60
61 // Induction variable's range is split at this value.
62 Value *SplitValue;
63
64 // Induction variable's final loop exit value.
65 Value *ExitValue;
66
67 // This compare instruction compares IndVar against SplitValue.
68 ICmpInst *SplitCondition;
69
70 // Loop exit condition.
71 ICmpInst *ExitCondition;
Devang Patel31696332007-08-08 21:18:27 +000072
73 // Clear split info.
74 void clear() {
75 IndVar = NULL;
76 SplitValue = NULL;
77 ExitValue = NULL;
78 SplitCondition = NULL;
79 ExitCondition = NULL;
80 }
Devang Patelc8dadbf2007-08-08 21:02:17 +000081 };
82
83 private:
Devang Patelbc5fe632007-08-07 00:25:56 +000084 /// Find condition inside a loop that is suitable candidate for index split.
85 void findSplitCondition();
86
87 /// processOneIterationLoop - Current loop L contains compare instruction
88 /// that compares induction variable, IndVar, agains loop invariant. If
89 /// entire (i.e. meaningful) loop body is dominated by this compare
90 /// instruction then loop body is executed only for one iteration. In
91 /// such case eliminate loop structure surrounding this loop body. For
Devang Patelc8dadbf2007-08-08 21:02:17 +000092 bool processOneIterationLoop(SplitInfo &SD, LPPassManager &LPM);
Devang Patelbc5fe632007-08-07 00:25:56 +000093
Devang Patel0aaeb172007-08-08 22:25:28 +000094 /// If loop header includes loop variant instruction operands then
95 /// this loop may not be eliminated.
Devang Patelc8dadbf2007-08-08 21:02:17 +000096 bool safeHeader(SplitInfo &SD, BasicBlock *BB);
Devang Patelbc5fe632007-08-07 00:25:56 +000097
Devang Patel0aaeb172007-08-08 22:25:28 +000098 /// If Exit block includes loop variant instructions then this
99 /// loop may not be eliminated.
Devang Patelc8dadbf2007-08-08 21:02:17 +0000100 bool safeExitBlock(SplitInfo &SD, BasicBlock *BB);
Devang Patelbc5fe632007-08-07 00:25:56 +0000101
Devang Patel0aaeb172007-08-08 22:25:28 +0000102 /// Find cost of spliting loop L.
103 unsigned findSplitCost(Loop *L, SplitInfo &SD);
Devang Patelc8dadbf2007-08-08 21:02:17 +0000104 bool splitLoop(SplitInfo &SD);
Devang Patelbc5fe632007-08-07 00:25:56 +0000105
106 private:
107
108 // Current Loop.
109 Loop *L;
110 ScalarEvolution *SE;
Devang Patel0aaeb172007-08-08 22:25:28 +0000111 DominatorTree *DT;
Devang Patelc8dadbf2007-08-08 21:02:17 +0000112 SmallVector<SplitInfo, 4> SplitData;
Devang Patelbc5fe632007-08-07 00:25:56 +0000113 };
114
115 char LoopIndexSplit::ID = 0;
116 RegisterPass<LoopIndexSplit> X ("loop-index-split", "Index Split Loops");
117}
118
119LoopPass *llvm::createLoopIndexSplitPass() {
120 return new LoopIndexSplit();
121}
122
123// Index split Loop L. Return true if loop is split.
124bool LoopIndexSplit::runOnLoop(Loop *IncomingLoop, LPPassManager &LPM) {
125 bool Changed = false;
126 L = IncomingLoop;
Devang Patelc8dadbf2007-08-08 21:02:17 +0000127
Devang Patelbc5fe632007-08-07 00:25:56 +0000128 SE = &getAnalysis<ScalarEvolution>();
Devang Patel0aaeb172007-08-08 22:25:28 +0000129 DT = &getAnalysis<DominatorTree>();
Devang Patelbc5fe632007-08-07 00:25:56 +0000130
131 findSplitCondition();
132
Devang Patelc8dadbf2007-08-08 21:02:17 +0000133 if (SplitData.empty())
Devang Patelbc5fe632007-08-07 00:25:56 +0000134 return false;
135
Devang Patelc8dadbf2007-08-08 21:02:17 +0000136 // First see if it is possible to eliminate loop itself or not.
137 for (SmallVector<SplitInfo, 4>::iterator SI = SplitData.begin(),
138 E = SplitData.end(); SI != E; ++SI) {
139 SplitInfo &SD = *SI;
140 if (SD.SplitCondition->getPredicate() == ICmpInst::ICMP_EQ) {
141 Changed = processOneIterationLoop(SD,LPM);
142 if (Changed) {
143 ++NumIndexSplit;
144 // If is loop is eliminated then nothing else to do here.
145 return Changed;
146 }
147 }
148 }
149
Devang Patel0aaeb172007-08-08 22:25:28 +0000150 unsigned MaxCost = 99;
151 unsigned Index = 0;
152 unsigned MostProfitableSDIndex = 0;
Devang Patelc8dadbf2007-08-08 21:02:17 +0000153 for (SmallVector<SplitInfo, 4>::iterator SI = SplitData.begin(),
Devang Patel0aaeb172007-08-08 22:25:28 +0000154 E = SplitData.end(); SI != E; ++SI, ++Index) {
155 SplitInfo SD = *SI;
Devang Patelc8dadbf2007-08-08 21:02:17 +0000156
157 // ICM_EQs are already handled above.
Devang Patel0aaeb172007-08-08 22:25:28 +0000158 if (SD.SplitCondition->getPredicate() == ICmpInst::ICMP_EQ)
Devang Patelc8dadbf2007-08-08 21:02:17 +0000159 continue;
Devang Patel0aaeb172007-08-08 22:25:28 +0000160
161 unsigned Cost = findSplitCost(L, SD);
162 if (Cost < MaxCost)
163 MostProfitableSDIndex = Index;
Devang Patelc8dadbf2007-08-08 21:02:17 +0000164 }
Devang Patelbc5fe632007-08-07 00:25:56 +0000165
Devang Patel0aaeb172007-08-08 22:25:28 +0000166 // Split most profitiable condition.
167 Changed = splitLoop(SplitData[MostProfitableSDIndex]);
168
Devang Patelbc5fe632007-08-07 00:25:56 +0000169 if (Changed)
170 ++NumIndexSplit;
Devang Patelc8dadbf2007-08-08 21:02:17 +0000171
Devang Patelbc5fe632007-08-07 00:25:56 +0000172 return Changed;
173}
174
175/// Find condition inside a loop that is suitable candidate for index split.
176void LoopIndexSplit::findSplitCondition() {
177
Devang Patelc8dadbf2007-08-08 21:02:17 +0000178 SplitInfo SD;
179 BasicBlock *Header = L->getHeader();
Devang Patelbc5fe632007-08-07 00:25:56 +0000180
181 for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
182 PHINode *PN = cast<PHINode>(I);
183
184 if (!PN->getType()->isInteger())
185 continue;
186
187 SCEVHandle SCEV = SE->getSCEV(PN);
188 if (!isa<SCEVAddRecExpr>(SCEV))
189 continue;
190
191 // If this phi node is used in a compare instruction then it is a
192 // split condition candidate.
193 for (Value::use_iterator UI = PN->use_begin(), E = PN->use_end();
194 UI != E; ++UI) {
195 if (ICmpInst *CI = dyn_cast<ICmpInst>(*UI)) {
Devang Patelc8dadbf2007-08-08 21:02:17 +0000196 SD.SplitCondition = CI;
Devang Patelbc5fe632007-08-07 00:25:56 +0000197 break;
198 }
199 }
200
201 // Valid SplitCondition's one operand is phi node and the other operand
202 // is loop invariant.
Devang Patelc8dadbf2007-08-08 21:02:17 +0000203 if (SD.SplitCondition) {
204 if (SD.SplitCondition->getOperand(0) != PN)
205 SD.SplitValue = SD.SplitCondition->getOperand(0);
Devang Patelbc5fe632007-08-07 00:25:56 +0000206 else
Devang Patelc8dadbf2007-08-08 21:02:17 +0000207 SD.SplitValue = SD.SplitCondition->getOperand(1);
208 SCEVHandle ValueSCEV = SE->getSCEV(SD.SplitValue);
Devang Patelbc5fe632007-08-07 00:25:56 +0000209
210 // If SplitValue is not invariant then SplitCondition is not appropriate.
211 if (!ValueSCEV->isLoopInvariant(L))
Devang Patelc8dadbf2007-08-08 21:02:17 +0000212 SD.SplitCondition = NULL;
Devang Patelbc5fe632007-08-07 00:25:56 +0000213 }
214
215 // We are looking for only one split condition.
Devang Patelc8dadbf2007-08-08 21:02:17 +0000216 if (SD.SplitCondition) {
217 SD.IndVar = PN;
218 SplitData.push_back(SD);
Devang Patel31696332007-08-08 21:18:27 +0000219 // Before reusing SD for next split condition clear its content.
220 SD.clear();
Devang Patelbc5fe632007-08-07 00:25:56 +0000221 }
222 }
223}
224
225/// processOneIterationLoop - Current loop L contains compare instruction
226/// that compares induction variable, IndVar, against loop invariant. If
227/// entire (i.e. meaningful) loop body is dominated by this compare
228/// instruction then loop body is executed only once. In such case eliminate
229/// loop structure surrounding this loop body. For example,
230/// for (int i = start; i < end; ++i) {
231/// if ( i == somevalue) {
232/// loop_body
233/// }
234/// }
235/// can be transformed into
236/// if (somevalue >= start && somevalue < end) {
237/// i = somevalue;
238/// loop_body
239/// }
Devang Patelc8dadbf2007-08-08 21:02:17 +0000240bool LoopIndexSplit::processOneIterationLoop(SplitInfo &SD, LPPassManager &LPM) {
Devang Patelbc5fe632007-08-07 00:25:56 +0000241
242 BasicBlock *Header = L->getHeader();
243
244 // First of all, check if SplitCondition dominates entire loop body
245 // or not.
246
247 // If SplitCondition is not in loop header then this loop is not suitable
248 // for this transformation.
Devang Patelc8dadbf2007-08-08 21:02:17 +0000249 if (SD.SplitCondition->getParent() != Header)
Devang Patelbc5fe632007-08-07 00:25:56 +0000250 return false;
251
252 // If one of the Header block's successor is not an exit block then this
253 // loop is not a suitable candidate.
254 BasicBlock *ExitBlock = NULL;
255 for (succ_iterator SI = succ_begin(Header), E = succ_end(Header); SI != E; ++SI) {
256 if (L->isLoopExit(*SI)) {
257 ExitBlock = *SI;
258 break;
259 }
260 }
261
262 if (!ExitBlock)
263 return false;
264
265 // If loop header includes loop variant instruction operands then
266 // this loop may not be eliminated.
Devang Patelc8dadbf2007-08-08 21:02:17 +0000267 if (!safeHeader(SD, Header))
Devang Patelbc5fe632007-08-07 00:25:56 +0000268 return false;
269
270 // If Exit block includes loop variant instructions then this
271 // loop may not be eliminated.
Devang Patelc8dadbf2007-08-08 21:02:17 +0000272 if (!safeExitBlock(SD, ExitBlock))
Devang Patelbc5fe632007-08-07 00:25:56 +0000273 return false;
274
Devang Patel2bcb5012007-08-08 01:51:27 +0000275 // Update CFG.
276
277 // As a first step to break this loop, remove Latch to Header edge.
Devang Patelbc5fe632007-08-07 00:25:56 +0000278 BasicBlock *Latch = L->getLoopLatch();
Devang Patel2bcb5012007-08-08 01:51:27 +0000279 BasicBlock *LatchSucc = NULL;
280 BranchInst *BR = dyn_cast<BranchInst>(Latch->getTerminator());
281 if (!BR)
282 return false;
283 Header->removePredecessor(Latch);
284 for (succ_iterator SI = succ_begin(Latch), E = succ_end(Latch);
285 SI != E; ++SI) {
286 if (Header != *SI)
287 LatchSucc = *SI;
288 }
289 BR->setUnconditionalDest(LatchSucc);
290
Devang Patelbc5fe632007-08-07 00:25:56 +0000291 BasicBlock *Preheader = L->getLoopPreheader();
292 Instruction *Terminator = Header->getTerminator();
Devang Patelc8dadbf2007-08-08 21:02:17 +0000293 Value *StartValue = SD.IndVar->getIncomingValueForBlock(Preheader);
Devang Patelbc5fe632007-08-07 00:25:56 +0000294
Devang Patelbc5fe632007-08-07 00:25:56 +0000295 // Replace split condition in header.
296 // Transform
297 // SplitCondition : icmp eq i32 IndVar, SplitValue
298 // into
299 // c1 = icmp uge i32 SplitValue, StartValue
300 // c2 = icmp ult i32 vSplitValue, ExitValue
301 // and i32 c1, c2
Devang Patelc8dadbf2007-08-08 21:02:17 +0000302 bool SignedPredicate = SD.ExitCondition->isSignedPredicate();
Devang Patelbc5fe632007-08-07 00:25:56 +0000303 Instruction *C1 = new ICmpInst(SignedPredicate ?
304 ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE,
Devang Patelc8dadbf2007-08-08 21:02:17 +0000305 SD.SplitValue, StartValue, "lisplit",
306 Terminator);
Devang Patelbc5fe632007-08-07 00:25:56 +0000307 Instruction *C2 = new ICmpInst(SignedPredicate ?
308 ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
Devang Patelc8dadbf2007-08-08 21:02:17 +0000309 SD.SplitValue, SD.ExitValue, "lisplit",
310 Terminator);
311 Instruction *NSplitCond = BinaryOperator::createAnd(C1, C2, "lisplit",
312 Terminator);
313 SD.SplitCondition->replaceAllUsesWith(NSplitCond);
314 SD.SplitCondition->eraseFromParent();
Devang Patelbc5fe632007-08-07 00:25:56 +0000315
Devang Patelbc5fe632007-08-07 00:25:56 +0000316 // Now, clear latch block. Remove instructions that are responsible
317 // to increment induction variable.
318 Instruction *LTerminator = Latch->getTerminator();
319 for (BasicBlock::iterator LB = Latch->begin(), LE = Latch->end();
320 LB != LE; ) {
321 Instruction *I = LB;
322 ++LB;
323 if (isa<PHINode>(I) || I == LTerminator)
324 continue;
325
326 I->replaceAllUsesWith(UndefValue::get(I->getType()));
Devang Patel0d75c292007-08-07 17:45:35 +0000327 I->eraseFromParent();
Devang Patelbc5fe632007-08-07 00:25:56 +0000328 }
329
330 LPM.deleteLoopFromQueue(L);
Devang Patel95fd7172007-08-08 21:39:47 +0000331
332 // Update Dominator Info.
333 // Only CFG change done is to remove Latch to Header edge. This
334 // does not change dominator tree because Latch did not dominate
335 // Header.
336 if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>()) {
337 DominanceFrontier::iterator HeaderDF = DF->find(Header);
338 if (HeaderDF != DF->end())
339 DF->removeFromFrontier(HeaderDF, Header);
340
341 DominanceFrontier::iterator LatchDF = DF->find(Latch);
342 if (LatchDF != DF->end())
343 DF->removeFromFrontier(LatchDF, Header);
344 }
Devang Patelbc5fe632007-08-07 00:25:56 +0000345 return true;
346}
347
348// If loop header includes loop variant instruction operands then
349// this loop can not be eliminated. This is used by processOneIterationLoop().
Devang Patelc8dadbf2007-08-08 21:02:17 +0000350bool LoopIndexSplit::safeHeader(SplitInfo &SD, BasicBlock *Header) {
Devang Patelbc5fe632007-08-07 00:25:56 +0000351
352 Instruction *Terminator = Header->getTerminator();
353 for(BasicBlock::iterator BI = Header->begin(), BE = Header->end();
354 BI != BE; ++BI) {
355 Instruction *I = BI;
356
Devang Patel2bcb5012007-08-08 01:51:27 +0000357 // PHI Nodes are OK. FIXME : Handle last value assignments.
Devang Patelbc5fe632007-08-07 00:25:56 +0000358 if (isa<PHINode>(I))
359 continue;
360
361 // SplitCondition itself is OK.
Devang Patelc8dadbf2007-08-08 21:02:17 +0000362 if (I == SD.SplitCondition)
Devang Patel2bcb5012007-08-08 01:51:27 +0000363 continue;
Devang Patelbc5fe632007-08-07 00:25:56 +0000364
365 // Terminator is also harmless.
366 if (I == Terminator)
367 continue;
368
369 // Otherwise we have a instruction that may not be safe.
370 return false;
371 }
372
373 return true;
374}
375
376// If Exit block includes loop variant instructions then this
377// loop may not be eliminated. This is used by processOneIterationLoop().
Devang Patelc8dadbf2007-08-08 21:02:17 +0000378bool LoopIndexSplit::safeExitBlock(SplitInfo &SD, BasicBlock *ExitBlock) {
Devang Patelbc5fe632007-08-07 00:25:56 +0000379
Devang Patelbc5fe632007-08-07 00:25:56 +0000380 Instruction *IndVarIncrement = NULL;
Devang Patel2bcb5012007-08-08 01:51:27 +0000381
Devang Patelbc5fe632007-08-07 00:25:56 +0000382 for (BasicBlock::iterator BI = ExitBlock->begin(), BE = ExitBlock->end();
383 BI != BE; ++BI) {
384 Instruction *I = BI;
385
Devang Patel2bcb5012007-08-08 01:51:27 +0000386 // PHI Nodes are OK. FIXME : Handle last value assignments.
Devang Patelbc5fe632007-08-07 00:25:56 +0000387 if (isa<PHINode>(I))
388 continue;
389
390 // Check if I is induction variable increment instruction.
391 if (BinaryOperator *BOp = dyn_cast<BinaryOperator>(I)) {
392 if (BOp->getOpcode() != Instruction::Add)
393 return false;
394
395 Value *Op0 = BOp->getOperand(0);
396 Value *Op1 = BOp->getOperand(1);
397 PHINode *PN = NULL;
398 ConstantInt *CI = NULL;
399
400 if ((PN = dyn_cast<PHINode>(Op0))) {
401 if ((CI = dyn_cast<ConstantInt>(Op1)))
402 IndVarIncrement = I;
403 } else
404 if ((PN = dyn_cast<PHINode>(Op1))) {
405 if ((CI = dyn_cast<ConstantInt>(Op0)))
406 IndVarIncrement = I;
407 }
408
Devang Patelc8dadbf2007-08-08 21:02:17 +0000409 if (IndVarIncrement && PN == SD.IndVar && CI->isOne())
Devang Patelbc5fe632007-08-07 00:25:56 +0000410 continue;
411 }
Devang Patel2bcb5012007-08-08 01:51:27 +0000412
Devang Patelbc5fe632007-08-07 00:25:56 +0000413 // I is an Exit condition if next instruction is block terminator.
414 // Exit condition is OK if it compares loop invariant exit value,
415 // which is checked below.
Devang Patel3719d4f2007-08-07 23:17:52 +0000416 else if (ICmpInst *EC = dyn_cast<ICmpInst>(I)) {
Devang Patelbc5fe632007-08-07 00:25:56 +0000417 ++BI;
418 Instruction *N = BI;
419 if (N == ExitBlock->getTerminator()) {
Devang Patelc8dadbf2007-08-08 21:02:17 +0000420 SD.ExitCondition = EC;
Devang Patel2bcb5012007-08-08 01:51:27 +0000421 continue;
Devang Patelbc5fe632007-08-07 00:25:56 +0000422 }
423 }
424
425 // Otherwise we have instruction that may not be safe.
426 return false;
427 }
428
429 // Check if Exit condition is comparing induction variable against
430 // loop invariant value. If one operand is induction variable and
431 // the other operand is loop invaraint then Exit condition is safe.
Devang Patelc8dadbf2007-08-08 21:02:17 +0000432 if (SD.ExitCondition) {
433 Value *Op0 = SD.ExitCondition->getOperand(0);
434 Value *Op1 = SD.ExitCondition->getOperand(1);
Devang Patelbc5fe632007-08-07 00:25:56 +0000435
436 Instruction *Insn0 = dyn_cast<Instruction>(Op0);
437 Instruction *Insn1 = dyn_cast<Instruction>(Op1);
438
439 if (Insn0 && Insn0 == IndVarIncrement)
Devang Patelc8dadbf2007-08-08 21:02:17 +0000440 SD.ExitValue = Op1;
Devang Patelbc5fe632007-08-07 00:25:56 +0000441 else if (Insn1 && Insn1 == IndVarIncrement)
Devang Patelc8dadbf2007-08-08 21:02:17 +0000442 SD.ExitValue = Op0;
Devang Patelbc5fe632007-08-07 00:25:56 +0000443
Devang Patelc8dadbf2007-08-08 21:02:17 +0000444 SCEVHandle ValueSCEV = SE->getSCEV(SD.ExitValue);
Devang Patelbc5fe632007-08-07 00:25:56 +0000445 if (!ValueSCEV->isLoopInvariant(L))
446 return false;
447 }
448
449 // We could not find any reason to consider ExitBlock unsafe.
450 return true;
451}
452
Devang Patel0aaeb172007-08-08 22:25:28 +0000453/// Find cost of spliting loop L. Cost is measured in terms of size growth.
454/// Size is growth is calculated based on amount of code duplicated in second
455/// loop.
456unsigned LoopIndexSplit::findSplitCost(Loop *L, SplitInfo &SD) {
457
458 unsigned Cost = 0;
459 BasicBlock *SDBlock = SD.SplitCondition->getParent();
460 for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
461 I != E; ++I) {
462 BasicBlock *BB = *I;
463 // If a block is not dominated by split condition block then
464 // it must be duplicated in both loops.
465 if (!DT->dominates(SDBlock, BB))
466 Cost += BB->size();
467 }
468
469 return Cost;
470}
471
Devang Patelc8dadbf2007-08-08 21:02:17 +0000472bool LoopIndexSplit::splitLoop(SplitInfo &SD) {
Devang Patelbc5fe632007-08-07 00:25:56 +0000473 // FIXME :)
474 return false;
475}