[LV] Add iv_outside_user ptr-ind variant test - #213263
Merged
Merged
Conversation
|
@llvm/pr-subscribers-llvm-transforms Author: Ramkumar Ramachandra (artagnon) ChangesThere was previously a doubt about whether the integer variant of the test should use wrap-flags on the latch exit value, which motivates us to add coverage for the ptr variant. Full diff: https://github.com/llvm/llvm-project/pull/213263.diff 1 Files Affected:
diff --git a/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll b/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll
index fb85fda0177b8..cc2d2a2308a19 100644
--- a/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll
+++ b/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll
@@ -677,6 +677,41 @@ for.end:
ret i32 %inc.2
}
+define ptr @postinc_not_iv_backedge_value_ptr_induction(ptr %p.init) {
+; CHECK-LABEL: define ptr @postinc_not_iv_backedge_value_ptr_induction(
+; CHECK-SAME: ptr [[P_INIT:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[P_END:%.*]] = getelementptr nusw nuw i8, ptr [[P_INIT]], i64 1024
+; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
+; CHECK: [[VECTOR_PH]]:
+; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
+; CHECK: [[VECTOR_BODY]]:
+; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2
+; CHECK-NEXT: [[TMP0:%.*]] = icmp eq i64 [[INDEX_NEXT]], 1024
+; CHECK-NEXT: br i1 [[TMP0]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], {{!llvm.loop ![0-9]+}}
+; CHECK: [[MIDDLE_BLOCK]]:
+; CHECK-NEXT: [[TMP1:%.*]] = getelementptr i8, ptr [[P_INIT]], i64 2
+; CHECK-NEXT: [[TMP2:%.*]] = getelementptr i8, ptr [[TMP1]], i64 1023
+; CHECK-NEXT: br label %[[END:.*]]
+; CHECK: [[END]]:
+; CHECK-NEXT: ret ptr [[TMP2]]
+;
+entry:
+ %p.end = getelementptr nuw nusw i8, ptr %p.init, i64 1024
+ br label %loop
+
+loop:
+ %p.iv = phi ptr [ %p.init, %entry ], [ %p.next, %loop ]
+ %p.next = getelementptr nuw i8, ptr %p.iv, i64 1
+ %ret = getelementptr i8, ptr %p.iv, i64 2
+ %ec = icmp eq ptr %p.next, %p.end
+ br i1 %ec, label %end, label %loop
+
+end:
+ ret ptr %ret
+}
+
define float @fp_postinc_use_fadd(float %init, ptr noalias nocapture %A, i64 %N, float %fpinc) {
; VEC-LABEL: define float @fp_postinc_use_fadd(
; VEC-SAME: float [[INIT:%.*]], ptr noalias captures(none) [[A:%.*]], i64 [[N:%.*]], float [[FPINC:%.*]]) {
|
There was previously a doubt about whether the integer variant of the test should use wrap-flags on the latch exit value, which motivates us to add coverage for the ptr variant.
artagnon
force-pushed
the
vplan-iv-outside-user-ptr-ind-test
branch
from
August 3, 2026 07:34
ff8c90f to
1c439cb
Compare
artagnon
enabled auto-merge (squash)
August 3, 2026 07:34
frederik-h
pushed a commit
to frederik-h/llvm-project
that referenced
this pull request
Aug 3, 2026
There was previously a doubt about whether the integer variant of the test should use wrap-flags on the latch exit value, which motivates us to add coverage for the ptr variant.
jgreenbaum
pushed a commit
to jgreenbaum/llvm-project
that referenced
this pull request
Aug 3, 2026
There was previously a doubt about whether the integer variant of the test should use wrap-flags on the latch exit value, which motivates us to add coverage for the ptr variant.
tfzee
pushed a commit
to tfzee/llvm-project
that referenced
this pull request
Aug 6, 2026
There was previously a doubt about whether the integer variant of the test should use wrap-flags on the latch exit value, which motivates us to add coverage for the ptr variant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was previously a doubt about whether the integer variant of the test should use wrap-flags on the latch exit value, which motivates us to add coverage for the ptr variant.