diff options
| author | James Molloy <james.molloy@arm.com> | 2014-08-08 12:41:08 +0000 |
|---|---|---|
| committer | James Molloy <james.molloy@arm.com> | 2014-08-08 12:41:08 +0000 |
| commit | 65b08f5e4690e21c712564ba6c49d4cdb4fe3ca5 (patch) | |
| tree | 54326ae5b567f1710feb2d88db47ef85e4997091 /llvm/test/Transforms/LoopVectorize | |
| parent | 3feea9c11a389a969f30473c9f70051246f5c935 (diff) | |
| download | bcm5719-llvm-65b08f5e4690e21c712564ba6c49d4cdb4fe3ca5.tar.gz bcm5719-llvm-65b08f5e4690e21c712564ba6c49d4cdb4fe3ca5.zip | |
[LoopVectorizer] Enable support for floating-point subtraction reductions
llvm-svn: 215200
Diffstat (limited to 'llvm/test/Transforms/LoopVectorize')
| -rw-r--r-- | llvm/test/Transforms/LoopVectorize/float-reduction.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopVectorize/float-reduction.ll b/llvm/test/Transforms/LoopVectorize/float-reduction.ll index 0dfbab07279..36eb992f0be 100644 --- a/llvm/test/Transforms/LoopVectorize/float-reduction.ll +++ b/llvm/test/Transforms/LoopVectorize/float-reduction.ll @@ -23,3 +23,25 @@ for.body: ; preds = %for.body, %entry for.end: ; preds = %for.body ret float %add } + +;CHECK-LABEL: @foosub( +;CHECK: fsub fast <4 x float> +;CHECK: ret +define float @foosub(float* nocapture %A, i32* nocapture %n) nounwind uwtable readonly ssp { +entry: + br label %for.body + +for.body: ; preds = %for.body, %entry + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] + %sum.04 = phi float [ 0.000000e+00, %entry ], [ %sub, %for.body ] + %arrayidx = getelementptr inbounds float* %A, i64 %indvars.iv + %0 = load float* %arrayidx, align 4 + %sub = fsub fast float %sum.04, %0 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, 200 + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body + ret float %sub +} |

