[PATCH] D156152: LoopVectorize/iv-select-cmp: add test for decreasing IV, const start
Ramkumar Ramachandra via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 26 06:15:46 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG110ec1863af6: LoopVectorize/iv-select-cmp: add test for decreasing IV, const start (authored by artagnon).
Changed prior to commit:
https://reviews.llvm.org/D156152?vs=543973&id=544334#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156152/new/
https://reviews.llvm.org/D156152
Files:
llvm/test/Transforms/LoopVectorize/iv-select-cmp.ll
Index: llvm/test/Transforms/LoopVectorize/iv-select-cmp.ll
===================================================================
--- llvm/test/Transforms/LoopVectorize/iv-select-cmp.ll
+++ llvm/test/Transforms/LoopVectorize/iv-select-cmp.ll
@@ -214,8 +214,30 @@
ret float %cond
}
-define i64 @not_vectorized_select_decreasing_induction_icmp(ptr nocapture readonly %a, ptr nocapture readonly %b, i64 %rdx.start, i64 %n) {
-; CHECK-LABEL: @not_vectorized_select_decreasing_induction_icmp
+define i64 @not_vectorized_select_decreasing_induction_icmp_const_start(ptr nocapture readonly %a) {
+; CHECK-LABEL: @not_vectorized_select_decreasing_induction_icmp_const_start
+; CHECK-NOT: vector.body:
+;
+entry:
+ br label %for.body
+
+for.body: ; preds = %entry, %for.body
+ %iv = phi i64 [ 19999, %entry ], [ %dec, %for.body ]
+ %rdx = phi i64 [ 331, %entry ], [ %spec.select, %for.body ]
+ %arrayidx = getelementptr inbounds i64, ptr %a, i64 %iv
+ %0 = load i64, ptr %arrayidx, align 8
+ %cmp = icmp sgt i64 %0, 3
+ %spec.select = select i1 %cmp, i64 %iv, i64 %rdx
+ %dec = add nsw i64 %iv, -1
+ %cmp.not = icmp eq i64 %iv, 0
+ br i1 %cmp.not, label %exit, label %for.body
+
+exit: ; preds = %for.body
+ ret i64 %spec.select
+}
+
+define i64 @not_vectorized_select_decreasing_induction_icmp_non_const_start(ptr nocapture readonly %a, ptr nocapture readonly %b, i64 %rdx.start, i64 %n) {
+; CHECK-LABEL: @not_vectorized_select_decreasing_induction_icmp_non_const_start
; CHECK-NOT: vector.body:
;
entry:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156152.544334.patch
Type: text/x-patch
Size: 1603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230726/d3145355/attachment.bin>
More information about the llvm-commits
mailing list