The patch replace the overflow check in loop vectorization with the minimum loop iterations check.
The loop minimum iterations check below ensures the loop has enough trip count so the generated
vector loop will likely be executed, and it covers the overflow check.
Differential Revision: http://reviews.llvm.org/D12107.
llvm-svn: 245952
diff --git a/llvm/test/Transforms/LoopVectorize/induction.ll b/llvm/test/Transforms/LoopVectorize/induction.ll
index 2fbb2de..48566ef 100644
--- a/llvm/test/Transforms/LoopVectorize/induction.ll
+++ b/llvm/test/Transforms/LoopVectorize/induction.ll
@@ -113,8 +113,8 @@
; condition and branch directly to the scalar loop.
; CHECK-LABEL: max_i32_backedgetaken
-; CHECK: %backedge.overflow = icmp eq i32 -1, -1
-; CHECK: br i1 %backedge.overflow, label %scalar.ph, label %overflow.checked
+; CHECK: %min.iters.check = icmp ult i32 0, 2
+; CHECK: br i1 %min.iters.check, label %scalar.ph, label %min.iters.checked
; CHECK: scalar.ph:
; CHECK: %bc.resume.val = phi i32 [ %resume.val, %middle.block ], [ 0, %0 ]