[SLP][NFC] Add a test with the optimistic extractelements emission, NFC#201192
Merged
alexey-bataev merged 1 commit intoJun 2, 2026
Conversation
Created using spr 1.3.7
|
@llvm/pr-subscribers-llvm-transforms Author: Alexey Bataev (alexey-bataev) Changes1 Files Affected:
diff --git a/llvm/test/Transforms/SLPVectorizer/ARM/extract-cost-scale-nullptr-user.ll b/llvm/test/Transforms/SLPVectorizer/ARM/extract-cost-scale-nullptr-user.ll
new file mode 100644
index 0000000000000..d6cab1545784b
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/ARM/extract-cost-scale-nullptr-user.ll
@@ -0,0 +1,71 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt -passes=slp-vectorizer -mtriple=thumbv8.1m.main-unknown-none-eabihf -S -mattr=+mve < %s | FileCheck %s
+
+define void @test(ptr %p) {
+; CHECK-LABEL: define void @test(
+; CHECK-SAME: ptr [[P:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*]]:
+; CHECK-NEXT: br label %[[LOOP:.*]]
+; CHECK: [[LOOP]]:
+; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[NIV:%.*]], %[[LOOP]] ]
+; CHECK-NEXT: [[TMP0:%.*]] = phi <4 x i32> [ zeroinitializer, %[[ENTRY]] ], [ [[TMP2:%.*]], %[[LOOP]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = extractelement <4 x i32> [[TMP0]], i32 3
+; CHECK-NEXT: [[A0:%.*]] = getelementptr i8, ptr [[P]], i32 [[TMP1]]
+; CHECK-NEXT: store i8 0, ptr [[A0]], align 1
+; CHECK-NEXT: [[A1:%.*]] = getelementptr i8, ptr [[P]], i32 [[TMP1]]
+; CHECK-NEXT: store i8 1, ptr [[A1]], align 1
+; CHECK-NEXT: [[A2:%.*]] = getelementptr i8, ptr [[P]], i32 [[TMP1]]
+; CHECK-NEXT: store i8 2, ptr [[A2]], align 1
+; CHECK-NEXT: [[A3:%.*]] = getelementptr i8, ptr [[P]], i32 [[TMP1]]
+; CHECK-NEXT: store i8 3, ptr [[A3]], align 1
+; CHECK-NEXT: [[A4:%.*]] = getelementptr i8, ptr [[P]], i32 [[TMP1]]
+; CHECK-NEXT: store i8 4, ptr [[A4]], align 1
+; CHECK-NEXT: [[A5:%.*]] = getelementptr i8, ptr [[P]], i32 [[TMP1]]
+; CHECK-NEXT: store i8 5, ptr [[A5]], align 1
+; CHECK-NEXT: [[A6:%.*]] = getelementptr i8, ptr [[P]], i32 [[TMP1]]
+; CHECK-NEXT: store i8 6, ptr [[A6]], align 1
+; CHECK-NEXT: [[A7:%.*]] = getelementptr i8, ptr [[P]], i32 [[TMP1]]
+; CHECK-NEXT: store i8 7, ptr [[A7]], align 1
+; CHECK-NEXT: [[TMP2]] = add nuw nsw <4 x i32> [[TMP0]], <i32 32, i32 32, i32 32, i32 16>
+; CHECK-NEXT: [[NIV]] = add nuw nsw i32 [[IV]], 16
+; CHECK-NEXT: [[C:%.*]] = icmp eq i32 [[NIV]], 512
+; CHECK-NEXT: br i1 [[C]], label %[[EXIT:.*]], label %[[LOOP]]
+; CHECK: [[EXIT]]:
+; CHECK-NEXT: ret void
+;
+entry:
+ br label %loop
+
+loop:
+ %i0 = phi i32 [ 0, %entry ], [ %n0, %loop ]
+ %i1 = phi i32 [ 0, %entry ], [ %n1, %loop ]
+ %i2 = phi i32 [ 0, %entry ], [ %n2, %loop ]
+ %i3 = phi i32 [ 0, %entry ], [ %n3, %loop ]
+ %iv = phi i32 [ 0, %entry ], [ %niv, %loop ]
+ %a0 = getelementptr i8, ptr %p, i32 %i1
+ store i8 0, ptr %a0, align 1
+ %a1 = getelementptr i8, ptr %p, i32 %i1
+ store i8 1, ptr %a1, align 1
+ %a2 = getelementptr i8, ptr %p, i32 %i1
+ store i8 2, ptr %a2, align 1
+ %a3 = getelementptr i8, ptr %p, i32 %i1
+ store i8 3, ptr %a3, align 1
+ %a4 = getelementptr i8, ptr %p, i32 %i1
+ store i8 4, ptr %a4, align 1
+ %a5 = getelementptr i8, ptr %p, i32 %i1
+ store i8 5, ptr %a5, align 1
+ %a6 = getelementptr i8, ptr %p, i32 %i1
+ store i8 6, ptr %a6, align 1
+ %a7 = getelementptr i8, ptr %p, i32 %i1
+ store i8 7, ptr %a7, align 1
+ %n0 = add nuw nsw i32 %i0, 32
+ %n1 = add nuw nsw i32 %i1, 16
+ %n2 = add nuw nsw i32 %i2, 32
+ %n3 = add nuw nsw i32 %i3, 32
+ %niv = add nuw nsw i32 %iv, 16
+ %c = icmp eq i32 %niv, 512
+ br i1 %c, label %exit, label %loop
+
+exit:
+ ret void
+}
|
llvm-upstreamsync Bot
pushed a commit
to qualcomm/cpullvm-toolchain
that referenced
this pull request
Jun 2, 2026
…emission, NFC Reviewers: Pull Request: llvm/llvm-project#201192
llvm-sync Bot
pushed a commit
to arm/arm-toolchain
that referenced
this pull request
Jun 2, 2026
…emission, NFC Reviewers: Pull Request: llvm/llvm-project#201192
yingopq
pushed a commit
to yingopq/llvm-project
that referenced
this pull request
Jun 5, 2026
Reviewers: Pull Request: llvm#201192
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.
No description provided.