diff options
| author | Devang Patel <dpatel@apple.com> | 2007-09-19 00:15:16 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2007-09-19 00:15:16 +0000 |
| commit | 455a53b7db42d4dd000a7e196a11b1a8bd329258 (patch) | |
| tree | fabfba8cd0c29771d8a1d6bdf8dd77d8465492c0 /llvm/lib/Transforms | |
| parent | 4c238c451ff8e65a10afe53ba77f05df1f4994c9 (diff) | |
| download | bcm5719-llvm-455a53b7db42d4dd000a7e196a11b1a8bd329258.tar.gz bcm5719-llvm-455a53b7db42d4dd000a7e196a11b1a8bd329258.zip | |
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
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp index 92a6058b5a6..cb5060a6765 100644 --- a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp +++ b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp @@ -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++) { |

