[llvm] LV: add crash-test for incomplete cases in VPlan (PR #93551)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 28 07:08:27 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Ramkumar Ramachandra (artagnon)
<details>
<summary>Changes</summary>
The test is identical to the one in vplan-infer-not-or-type.ll, except that the trip count is now 3 instead of 2.
---
Full diff: https://github.com/llvm/llvm-project/pull/93551.diff
1 Files Affected:
- (added) llvm/test/Transforms/LoopVectorize/vplan-incomplete-cases.ll (+25)
``````````diff
diff --git a/llvm/test/Transforms/LoopVectorize/vplan-incomplete-cases.ll b/llvm/test/Transforms/LoopVectorize/vplan-incomplete-cases.ll
new file mode 100644
index 0000000000000..2f3ed0d69d269
--- /dev/null
+++ b/llvm/test/Transforms/LoopVectorize/vplan-incomplete-cases.ll
@@ -0,0 +1,25 @@
+; REQUIRES: asserts
+; RUN: not --crash opt %s -passes=loop-vectorize -S
+
+define void @vplan_incomplete_cases_tc3(i8 %x, i8 %y) {
+entry:
+ br label %loop.header
+
+loop.header: ; preds = %latch, %entry
+ %iv = phi i8 [ %iv.next, %latch ], [ 0, %entry ]
+ %and = and i8 %x, %y
+ %extract.t = trunc i8 %and to i1
+ br i1 %extract.t, label %latch, label %indirect.latch
+
+indirect.latch: ; preds = %loop.header
+ br label %latch
+
+latch: ; preds = %indirect.latch, loop.header
+ %iv.next = add i8 %iv, 1
+ %zext = zext i8 %iv to i32
+ %cmp = icmp ult i32 %zext, 2
+ br i1 %cmp, label %loop.header, label %exit
+
+exit: ; preds = %latch
+ ret void
+}
``````````
</details>
https://github.com/llvm/llvm-project/pull/93551
More information about the llvm-commits
mailing list