Filter loops where split condition's false branch is not empty. For example

for (int i = 0; i < N; ++i) {
  if (i == somevalue)
    dosomething();
   else
    dosomethingelse();
}

llvm-svn: 42121
This commit is contained in:
Devang Patel 2007-09-19 00:15:16 +00:00
parent 4c238c451f
commit 455a53b7db
1 changed files with 4 additions and 0 deletions

View File

@ -528,6 +528,10 @@ bool LoopIndexSplit::processOneIterationLoop(SplitInfo &SD) {
if (!safeExitingBlock(SD, ExitCondition->getParent()))
return false;
// Filter loops where split condition's false branch is not empty.
if (ExitCondition->getParent() != Header->getTerminator()->getSuccessor(1))
return false;
// If split condition is not safe then do not process this loop.
// For example,
// for(int i = 0; i < N; i++) {