Vectorizer: fix a bug in the classification of induction/reduction phis.
authorNadav Rotem <nrotem@apple.com>
Sun, 21 Oct 2012 02:38:01 +0000 (02:38 +0000)
committerNadav Rotem <nrotem@apple.com>
Sun, 21 Oct 2012 02:38:01 +0000 (02:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166384 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/2012-10-20-infloop.ll

index 027fe0656be5d29c89c77b72a0715ed4761a3b54..76936d52c9923138bc8a4b2fd49b14ff95674bda 100644 (file)
@@ -950,6 +950,9 @@ bool LoopVectorizationLegality::canVectorizeBlock(BasicBlock &BB) {
         DEBUG(dbgs() << "LV: Found an Mult reduction PHI."<< *Phi <<"\n");
         continue;
       }
+
+      DEBUG(dbgs() << "LV: Found an unidentified PHI."<< *Phi <<"\n");
+      return false;
     }// end of PHI handling
 
     // We still don't handle functions.
index 16a77291995d07622cce74aba977b3f8e96d4309..5caaffc8ddea4c09fcdd5d210a06f7f37009e96c 100644 (file)
@@ -10,3 +10,18 @@ for.body:
  br label %for.body
 }
 
+
+
+define void @test2() nounwind {
+entry:
+ br label %for.body
+
+for.body:                                         ; preds = %for.body, %entry
+ %indvars.iv47 = phi i64 [ 0, %entry ], [ %indvars.iv.next48, %for.body ]
+ %0 = phi i32 [ 1, %entry ], [ 0, %for.body ]
+ %indvars.iv.next48 = add i64 %indvars.iv47, 1
+ br i1 undef, label %for.end, label %for.body
+
+for.end:                                          ; preds = %for.body
+ unreachable
+}