forked from OSchip/llvm-project
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:
parent
4c238c451f
commit
455a53b7db
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue