[llvm-commits] [llvm] r42121 - /llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
Devang Patel
dpatel at apple.com
Tue Sep 18 17:15:16 PDT 2007
Author: dpatel
Date: Tue Sep 18 19:15:16 2007
New Revision: 42121
URL: http://llvm.org/viewvc/llvm-project?rev=42121&view=rev
Log:
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();
}
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=42121&r1=42120&r2=42121&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Tue Sep 18 19:15:16 2007
@@ -528,6 +528,10 @@
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++) {
More information about the llvm-commits
mailing list