@@ -101,12 +101,6 @@ static cl::opt<unsigned int> MaxLoopNestDepth(
101101 " loop-interchange-max-loop-nest-depth" , cl::init(10 ), cl::Hidden,
102102 cl::desc(" Maximum depth of loop nest considered for the transform" ));
103103
104- // This is mainly for testing purposes, and certain tests that rely on
105- // behaviour that is more difficult to trigger otherwise.
106- static cl::opt<bool > SkipLoopsWithZeroBTC (
107- " loop-interchange-skip-zero-btc" , cl::init(true ), cl::Hidden,
108- cl::desc(" Do not consider loops with a backedge taken count of 0" ));
109-
110104// We prefer cache cost to vectorization by default.
111105static cl::list<RuleTy> Profitabilities (
112106 " loop-interchange-profitabilities" , cl::ZeroOrMore,
@@ -126,6 +120,13 @@ static cl::list<RuleTy> Profitabilities(
126120 " Ignore profitability, force interchange (does not "
127121 " work with other options)" )));
128122
123+ // FIXME: this option exists mainly for a couple of tests that check some
124+ // corner cases that is more difficult to trigger otherwise; these tests should
125+ // be rewritten and this option removed if possible.
126+ static cl::opt<bool > SkipLoopsWithZeroBTC (
127+ " loop-interchange-skip-zero-btc" , cl::init(true ), cl::Hidden,
128+ cl::desc(" Do not consider loops with a backedge taken count of 0" ));
129+
129130#ifndef NDEBUG
130131static bool noDuplicateRulesAndIgnore (ArrayRef<RuleTy> Rules) {
131132 SmallSet<RuleTy, 4 > Set;
@@ -438,7 +439,8 @@ static bool isComputableLoopNest(ScalarEvolution *SE,
438439 // true, isn't really a loop and we don't want to consider it as a
439440 // candidate.
440441 if (ExitCountOuter && SkipLoopsWithZeroBTC && ExitCountOuter->isZero ()) {
441- LLVM_DEBUG (dbgs () << " Single iteration loop\n " );
442+ LLVM_DEBUG (dbgs () << " The loop back-edge isn't taken, rejecting single "
443+ " iteration loop\n " );
442444 return false ;
443445 }
444446 if (L->getNumBackEdges () != 1 ) {
0 commit comments