diff options
| author | Wei Mi <wmi@google.com> | 2016-08-02 20:27:49 +0000 |
|---|---|---|
| committer | Wei Mi <wmi@google.com> | 2016-08-02 20:27:49 +0000 |
| commit | dc7001afb2d58c56d9c6c6f483fac12a59031f91 (patch) | |
| tree | d5d3c03c71a85d1051ab9b3fcff66b676876da18 /llvm/test/Transforms/LoopVectorize | |
| parent | dabcee8b2c3dac44aac7fc8a1029c7282ae05c6f (diff) | |
| download | bcm5719-llvm-dc7001afb2d58c56d9c6c6f483fac12a59031f91.tar.gz bcm5719-llvm-dc7001afb2d58c56d9c6c6f483fac12a59031f91.zip | |
[LoopVectorize] Change comment for isOutOfScope in collectLoopUniforms, NFC
Update comment for isOutOfScope and add a testcase for uniform value being used
out of scope.
Differential Revision: https://reviews.llvm.org/D23073
llvm-svn: 277515
Diffstat (limited to 'llvm/test/Transforms/LoopVectorize')
| -rw-r--r-- | llvm/test/Transforms/LoopVectorize/X86/uniform-phi.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopVectorize/X86/uniform-phi.ll b/llvm/test/Transforms/LoopVectorize/X86/uniform-phi.ll index 1759cb81976..881f29a94cb 100644 --- a/llvm/test/Transforms/LoopVectorize/X86/uniform-phi.ll +++ b/llvm/test/Transforms/LoopVectorize/X86/uniform-phi.ll @@ -48,3 +48,30 @@ for.body: for.end: ret void } + +; CHECK-LABEL: goo +; Check %indvars.iv and %indvars.iv.next are uniform instructions even if they are used outside of loop. +; CHECK-DAG: LV: Found uniform instruction: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] +; CHECK-DAG: LV: Found uniform instruction: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 +; CHECK-DAG: LV: Found uniform instruction: %exitcond = icmp eq i64 %indvars.iv, 1599 + +define i64 @goo(float* noalias nocapture %a, float* noalias nocapture readonly %b) #0 { +entry: + br label %for.body + +for.body: ; preds = %for.body, %entry + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] + %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv + %tmp0 = load float, float* %arrayidx, align 4 + %add = fadd float %tmp0, 1.000000e+00 + %arrayidx5 = getelementptr inbounds float, float* %a, i64 %indvars.iv + store float %add, float* %arrayidx5, align 4 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %exitcond = icmp eq i64 %indvars.iv, 1599 + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body + %retval = add i64 %indvars.iv, %indvars.iv.next + ret i64 %retval +} + |

