[llvm] r200408 - LoopVectorizer: Add a test case for unrolling of small loops that need a runtime

Arnold Schwaighofer aschwaighofer at apple.com
Wed Jan 29 10:55:45 PST 2014


Author: arnolds
Date: Wed Jan 29 12:55:44 2014
New Revision: 200408

URL: http://llvm.org/viewvc/llvm-project?rev=200408&view=rev
Log:
LoopVectorizer: Add a test case for unrolling of small loops that need a runtime
check.

Modified:
    llvm/trunk/test/Transforms/LoopVectorize/X86/unroll-small-loops.ll

Modified: llvm/trunk/test/Transforms/LoopVectorize/X86/unroll-small-loops.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopVectorize/X86/unroll-small-loops.ll?rev=200408&r1=200407&r2=200408&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopVectorize/X86/unroll-small-loops.ll (original)
+++ llvm/trunk/test/Transforms/LoopVectorize/X86/unroll-small-loops.ll Wed Jan 29 12:55:44 2014
@@ -48,3 +48,26 @@ define i32 @bar(i32* nocapture %A, i32 %
 ._crit_edge:                                      ; preds = %.lr.ph, %0
   ret i32 undef
 }
+
+; Also unroll if we need a runtime check.
+; CHECK-LABEL: runtime_chk
+; CHECK: store <4 x float>
+; CHECK: store <4 x float>
+define void @runtime_chk(float* %A, float* %B, float %N) {
+entry:
+  br label %for.body
+
+for.body:
+  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+  %arrayidx = getelementptr inbounds float* %B, i64 %indvars.iv
+  %0 = load float* %arrayidx, align 4
+  %mul = fmul float %0, %N
+  %arrayidx2 = getelementptr inbounds float* %A, i64 %indvars.iv
+  store float %mul, float* %arrayidx2, align 4
+  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+  %exitcond = icmp eq i64 %indvars.iv.next, 256
+  br i1 %exitcond, label %for.end, label %for.body
+
+for.end:
+  ret void
+}





More information about the llvm-commits mailing list