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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181495 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Arnold Schwaighofer
2013-05-09 00:32:18 +00:00
parent 96e70b2a00
commit c121f5dc26
2 changed files with 36 additions and 1 deletions
+2 -1
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;