Skip to content

LV: add crash-test for incomplete cases in VPlan #93551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

artagnon
Copy link
Contributor

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.

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.
@llvmbot
Copy link
Member

llvmbot commented May 28, 2024

@llvm/pr-subscribers-llvm-transforms

Author: Ramkumar Ramachandra (artagnon)

Changes

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 --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
+}

@fhahn
Copy link
Contributor

fhahn commented May 31, 2024

Might be good to keep those tests together (tests for other missed cases are in llvm/test/Transforms/LoopVectorize/vplan-infer-not-or-type.ll, file name would need adjusting)

@artagnon
Copy link
Contributor Author

I didn't want to invalidate the test in infer-not-or-type.ll by adding a crash test, so I consolidate the files in the fix (#93553).

@artagnon
Copy link
Contributor Author

artagnon commented Jun 4, 2024

Squashing this into #93553.

@artagnon artagnon closed this Jun 4, 2024
@artagnon artagnon deleted the vplan-incomplete-test branch June 4, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants