LoopVectorizer: Don't assert on the absence of induction variables

A computable loop exit count does not imply the presence of an induction
variable. Scalar evolution can return a value for an infinite loop.

Fixes PR15926.

llvm-svn: 181495
This commit is contained in:
Arnold Schwaighofer
2013-05-09 00:32:18 +00:00
parent b613dfadcb
commit 2e8c69cf97
2 changed files with 36 additions and 1 deletions

View File

@@ -2523,7 +2523,8 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
if (!Induction) {
DEBUG(dbgs() << "LV: Did not find one integer induction var.\n");
assert(getInductionVars()->size() && "No induction variables");
if (Inductions.empty())
return false;
}
return true;