[PATCH] D70295: [ARM][MVE] tail-predication
Sjoerd Meijer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 15 01:58:51 PST 2019
SjoerdMeijer created this revision.
SjoerdMeijer added a reviewer: samparker.
Herald added subscribers: dmgreen, hiraditya, kristof.beyls.
Herald added a project: LLVM.
Also flag fmcp instructions as instructions that we do not support in tail-predicated vector loops.
https://reviews.llvm.org/D70295
Files:
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
llvm/test/Transforms/LoopVectorize/ARM/prefer-tail-loop-folding.ll
Index: llvm/test/Transforms/LoopVectorize/ARM/prefer-tail-loop-folding.ll
===================================================================
--- llvm/test/Transforms/LoopVectorize/ARM/prefer-tail-loop-folding.ll
+++ llvm/test/Transforms/LoopVectorize/ARM/prefer-tail-loop-folding.ll
@@ -322,6 +322,32 @@
ret i32 0
}
+ at ftab = common global [32 x float] zeroinitializer, align 1
+
+define float @fcmp_not_allowed() #0 {
+; CHECK-LABEL: fcmp_not_allowed(
+; PREFER-FOLDING: vector.body:
+; PREFER-FOLDING-NOT: llvm.masked.load
+; PREFER-FOLDING-NOT: llvm.masked.store
+; PREFER-FOLDING: br i1 %{{.*}}, label %{{.*}}, label %vector.body
+entry:
+ br label %for.body
+
+for.body:
+ %i.08 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
+ %arrayidx = getelementptr inbounds [32 x float], [32 x float]* @ftab, i32 0, i32 %i.08
+ %0 = load float, float* %arrayidx, align 4
+ %cmp1 = fcmp oeq float %0, 0.000000e+00
+ %. = select i1 %cmp1, float 2.000000e+00, float 1.000000e+00
+ store float %., float* %arrayidx, align 4
+ %inc = add nsw i32 %i.08, 1
+ %exitcond = icmp slt i32 %inc, 999
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.end:
+ ret float 0.000000e+00
+}
+
define void @pragma_vect_predicate_disable(i32* noalias nocapture %A, i32* noalias nocapture readonly %B, i32* noalias nocapture readonly %C) #0 {
; CHECK-LABEL: pragma_vect_predicate_disable(
; PREFER-FOLDING: vector.body:
Index: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
+++ llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
@@ -1008,6 +1008,9 @@
if (isa<ICmpInst>(&I) && ++ICmpCount > 1)
return false;
+ if (isa<FCmpInst>(&I))
+ return false;
+
// We could allow extending/narrowing FP loads/stores, but codegen is
// too inefficient so reject this for now.
if (isa<FPExtInst>(&I) || isa<FPTruncInst>(&I))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70295.229474.patch
Type: text/x-patch
Size: 1971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191115/ddfb4d14/attachment.bin>
More information about the llvm-commits
mailing list