[SLP][NFC]Add an extra test with altop nodes reordering, NFC - #215367
Merged
alexey-bataev merged 1 commit intoAug 10, 2026
Merged
Conversation
Created using spr 1.3.7
|
@llvm/pr-subscribers-llvm-transforms Author: Alexey Bataev (alexey-bataev) ChangesFull diff: https://github.com/llvm/llvm-project/pull/215367.diff 1 Files Affected:
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/supernode.ll b/llvm/test/Transforms/SLPVectorizer/X86/supernode.ll
index 8c3aac2d59c11..468e5c247e11b 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/supernode.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/supernode.ll
@@ -124,6 +124,61 @@ entry:
ret void
}
+; S[0] = ((A[0] - B[0]) - D[0]) - C[0]
+; S[1] = ((B[1] + C[1]) + D[1]) + A[1]
+define void @test_addsub_alt_commuted(ptr %Aarray, ptr %Barray, ptr %Carray, ptr %Darray, ptr %Sarray) {
+; ENABLED-LABEL: @test_addsub_alt_commuted(
+; ENABLED-NEXT: entry:
+; ENABLED-NEXT: [[TMP0:%.*]] = load <2 x double>, ptr [[AARRAY:%.*]], align 8
+; ENABLED-NEXT: [[TMP1:%.*]] = load <2 x double>, ptr [[BARRAY:%.*]], align 8
+; ENABLED-NEXT: [[TMP2:%.*]] = load <2 x double>, ptr [[CARRAY:%.*]], align 8
+; ENABLED-NEXT: [[TMP3:%.*]] = load <2 x double>, ptr [[DARRAY:%.*]], align 8
+; ENABLED-NEXT: [[TMP4:%.*]] = shufflevector <2 x double> [[TMP0]], <2 x double> [[TMP2]], <2 x i32> <i32 0, i32 3>
+; ENABLED-NEXT: [[TMP5:%.*]] = fsub fast <2 x double> [[TMP4]], [[TMP1]]
+; ENABLED-NEXT: [[TMP12:%.*]] = fadd fast <2 x double> [[TMP4]], [[TMP1]]
+; ENABLED-NEXT: [[TMP7:%.*]] = shufflevector <2 x double> [[TMP5]], <2 x double> [[TMP12]], <2 x i32> <i32 0, i32 3>
+; ENABLED-NEXT: [[TMP8:%.*]] = fsub fast <2 x double> [[TMP7]], [[TMP3]]
+; ENABLED-NEXT: [[TMP13:%.*]] = fadd fast <2 x double> [[TMP7]], [[TMP3]]
+; ENABLED-NEXT: [[TMP14:%.*]] = shufflevector <2 x double> [[TMP8]], <2 x double> [[TMP13]], <2 x i32> <i32 0, i32 3>
+; ENABLED-NEXT: [[TMP11:%.*]] = shufflevector <2 x double> [[TMP2]], <2 x double> [[TMP0]], <2 x i32> <i32 0, i32 3>
+; ENABLED-NEXT: [[TMP6:%.*]] = fsub fast <2 x double> [[TMP14]], [[TMP11]]
+; ENABLED-NEXT: [[TMP9:%.*]] = fadd fast <2 x double> [[TMP14]], [[TMP11]]
+; ENABLED-NEXT: [[TMP10:%.*]] = shufflevector <2 x double> [[TMP6]], <2 x double> [[TMP9]], <2 x i32> <i32 0, i32 3>
+; ENABLED-NEXT: store <2 x double> [[TMP10]], ptr [[SARRAY:%.*]], align 8
+; ENABLED-NEXT: ret void
+;
+entry:
+ %idxA1 = getelementptr inbounds double, ptr %Aarray, i64 1
+ %idxB1 = getelementptr inbounds double, ptr %Barray, i64 1
+ %idxC1 = getelementptr inbounds double, ptr %Carray, i64 1
+ %idxD1 = getelementptr inbounds double, ptr %Darray, i64 1
+ %idxS1 = getelementptr inbounds double, ptr %Sarray, i64 1
+
+ %A0 = load double, ptr %Aarray, align 8
+ %A1 = load double, ptr %idxA1, align 8
+
+ %B0 = load double, ptr %Barray, align 8
+ %B1 = load double, ptr %idxB1, align 8
+
+ %C0 = load double, ptr %Carray, align 8
+ %C1 = load double, ptr %idxC1, align 8
+
+ %D0 = load double, ptr %Darray, align 8
+ %D1 = load double, ptr %idxD1, align 8
+
+ %subA0B0 = fsub fast double %A0, %B0
+ %addB1C1 = fadd fast double %B1, %C1
+
+ %subA0B0D0 = fsub fast double %subA0B0, %D0
+ %addB1C1D1 = fadd fast double %D1, %addB1C1
+
+ %sub0 = fsub fast double %subA0B0D0, %C0
+ %add1 = fadd fast double %addB1C1D1, %A1
+ store double %sub0, ptr %Sarray, align 8
+ store double %add1, ptr %idxS1, align 8
+ ret void
+}
+
; This checks that vectorizeTree() works correctly with the supernode
; and does not generate uses before defs.
; If all of the operands of the supernode are vectorizable, then the scheduler
|
alexey-bataev
deleted the
users/alexey-bataev/spr/slpnfcadd-an-extra-test-with-altop-nodes-reordering-nfc
branch
August 10, 2026 19:04
llvm-sync Bot
pushed a commit
to arm/arm-toolchain
that referenced
this pull request
Aug 10, 2026
Reviewers: Pull Request: llvm/llvm-project#215367
llvm-upstreamsync Bot
pushed a commit
to qualcomm/cpullvm-toolchain
that referenced
this pull request
Aug 10, 2026
Reviewers: Pull Request: llvm/llvm-project#215367
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.