[llvm] [SLP][NFC]Remove undef from the test, cleanup, NFC (PR #207545)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 4 15:21:25 PDT 2026


https://github.com/alexey-bataev created https://github.com/llvm/llvm-project/pull/207545

None

>From a036e14d2180dab5a3966e73ba39a3644fc928ea Mon Sep 17 00:00:00 2001
From: Alexey Bataev <a.bataev at outlook.com>
Date: Sat, 4 Jul 2026 15:21:13 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.7
---
 .../Transforms/SLPVectorizer/X86/resched.ll   | 63 +++++++++----------
 1 file changed, 31 insertions(+), 32 deletions(-)

diff --git a/llvm/test/Transforms/SLPVectorizer/X86/resched.ll b/llvm/test/Transforms/SLPVectorizer/X86/resched.ll
index 193e375516673..636234b448072 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/resched.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/resched.ll
@@ -3,21 +3,20 @@
 
 %"struct.std::array" = type { [32 x i8] }
 
-; Function Attrs: nounwind uwtable
-define fastcc void @_ZN12_GLOBAL__N_127PolynomialMultiplyRecognize9recognizeEv(i1 %arg) unnamed_addr #0 align 2 {
-; CHECK-LABEL: @_ZN12_GLOBAL__N_127PolynomialMultiplyRecognize9recognizeEv(
+define void @test(i1 %arg, i32 %a, ptr %p) {
+; CHECK-LABEL: @test(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br i1 [[ARG:%.*]], label [[IF_END50_I:%.*]], label [[IF_THEN22_I:%.*]]
 ; CHECK:       if.then22.i:
-; CHECK-NEXT:    [[SUB_I:%.*]] = add nsw i32 undef, -1
-; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i32> poison, i32 [[SUB_I]], i32 0
-; CHECK-NEXT:    [[TMP1:%.*]] = shufflevector <2 x i32> [[TMP0]], <2 x i32> poison, <2 x i32> zeroinitializer
-; CHECK-NEXT:    [[TMP2:%.*]] = and <2 x i32> [[TMP1]], <i32 -1, i32 undef>
-; CHECK-NEXT:    [[TMP3:%.*]] = shufflevector <2 x i32> [[TMP2]], <2 x i32> poison, <16 x i32> <i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
-; CHECK-NEXT:    [[TMP4:%.*]] = lshr <16 x i32> [[TMP3]], <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
-; CHECK-NEXT:    [[TMP16:%.*]] = trunc <16 x i32> [[TMP4]] to <16 x i8>
-; CHECK-NEXT:    [[TMP17:%.*]] = and <16 x i8> [[TMP16]], splat (i8 1)
-; CHECK-NEXT:    store <16 x i8> [[TMP17]], ptr undef, align 1
+; CHECK-NEXT:    [[SUB_I:%.*]] = add nsw i32 [[A:%.*]], -1
+; CHECK-NEXT:    [[CONV31_I:%.*]] = and i32 [[A]], [[SUB_I]]
+; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <16 x i32> poison, i32 [[SUB_I]], i32 0
+; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <16 x i32> [[TMP0]], i32 [[CONV31_I]], i32 1
+; CHECK-NEXT:    [[TMP2:%.*]] = shufflevector <16 x i32> [[TMP1]], <16 x i32> poison, <16 x i32> <i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
+; CHECK-NEXT:    [[TMP3:%.*]] = lshr <16 x i32> [[TMP2]], <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
+; CHECK-NEXT:    [[TMP4:%.*]] = trunc <16 x i32> [[TMP3]] to <16 x i8>
+; CHECK-NEXT:    [[TMP5:%.*]] = and <16 x i8> [[TMP4]], splat (i8 1)
+; CHECK-NEXT:    store <16 x i8> [[TMP5]], ptr [[P:%.*]], align 1
 ; CHECK-NEXT:    ret void
 ; CHECK:       if.end50.i:
 ; CHECK-NEXT:    ret void
@@ -25,89 +24,89 @@ define fastcc void @_ZN12_GLOBAL__N_127PolynomialMultiplyRecognize9recognizeEv(i
 entry:
   br i1 %arg, label %if.end50.i, label %if.then22.i
 
-if.then22.i:                                      ; preds = %entry
-  %sub.i = add nsw i32 undef, -1
-  %conv31.i = and i32 undef, %sub.i
+if.then22.i:
+  %sub.i = add nsw i32 %a, -1
+  %conv31.i = and i32 %a, %sub.i
   %0 = trunc i32 %sub.i to i8
   %conv.i.i1199 = and i8 %0, 1
-  store i8 %conv.i.i1199, ptr undef, align 1
+  store i8 %conv.i.i1199, ptr %p, align 1
   %shr.i.i = lshr i32 %conv31.i, 1
   %1 = trunc i32 %shr.i.i to i8
   %conv.1.i.i = and i8 %1, 1
-  %arrayidx.i.i7.1.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 1
+  %arrayidx.i.i7.1.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 1
   store i8 %conv.1.i.i, ptr %arrayidx.i.i7.1.i.i, align 1
   %shr.1.i.i = lshr i32 %conv31.i, 2
   %2 = trunc i32 %shr.1.i.i to i8
   %conv.2.i.i = and i8 %2, 1
-  %arrayidx.i.i7.2.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 2
+  %arrayidx.i.i7.2.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 2
   store i8 %conv.2.i.i, ptr %arrayidx.i.i7.2.i.i, align 1
   %shr.2.i.i = lshr i32 %conv31.i, 3
   %3 = trunc i32 %shr.2.i.i to i8
   %conv.3.i.i = and i8 %3, 1
-  %arrayidx.i.i7.3.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 3
+  %arrayidx.i.i7.3.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 3
   store i8 %conv.3.i.i, ptr %arrayidx.i.i7.3.i.i, align 1
   %shr.3.i.i = lshr i32 %conv31.i, 4
   %4 = trunc i32 %shr.3.i.i to i8
   %conv.4.i.i = and i8 %4, 1
-  %arrayidx.i.i7.4.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 4
+  %arrayidx.i.i7.4.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 4
   store i8 %conv.4.i.i, ptr %arrayidx.i.i7.4.i.i, align 1
   %shr.4.i.i = lshr i32 %conv31.i, 5
   %5 = trunc i32 %shr.4.i.i to i8
   %conv.5.i.i = and i8 %5, 1
-  %arrayidx.i.i7.5.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 5
+  %arrayidx.i.i7.5.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 5
   store i8 %conv.5.i.i, ptr %arrayidx.i.i7.5.i.i, align 1
   %shr.5.i.i = lshr i32 %conv31.i, 6
   %6 = trunc i32 %shr.5.i.i to i8
   %conv.6.i.i = and i8 %6, 1
-  %arrayidx.i.i7.6.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 6
+  %arrayidx.i.i7.6.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 6
   store i8 %conv.6.i.i, ptr %arrayidx.i.i7.6.i.i, align 1
   %shr.6.i.i = lshr i32 %conv31.i, 7
   %7 = trunc i32 %shr.6.i.i to i8
   %conv.7.i.i = and i8 %7, 1
-  %arrayidx.i.i7.7.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 7
+  %arrayidx.i.i7.7.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 7
   store i8 %conv.7.i.i, ptr %arrayidx.i.i7.7.i.i, align 1
   %shr.7.i.i = lshr i32 %conv31.i, 8
   %8 = trunc i32 %shr.7.i.i to i8
   %conv.8.i.i = and i8 %8, 1
-  %arrayidx.i.i7.8.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 8
+  %arrayidx.i.i7.8.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 8
   store i8 %conv.8.i.i, ptr %arrayidx.i.i7.8.i.i, align 1
   %shr.8.i.i = lshr i32 %conv31.i, 9
   %9 = trunc i32 %shr.8.i.i to i8
   %conv.9.i.i = and i8 %9, 1
-  %arrayidx.i.i7.9.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 9
+  %arrayidx.i.i7.9.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 9
   store i8 %conv.9.i.i, ptr %arrayidx.i.i7.9.i.i, align 1
   %shr.9.i.i = lshr i32 %conv31.i, 10
   %10 = trunc i32 %shr.9.i.i to i8
   %conv.10.i.i = and i8 %10, 1
-  %arrayidx.i.i7.10.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 10
+  %arrayidx.i.i7.10.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 10
   store i8 %conv.10.i.i, ptr %arrayidx.i.i7.10.i.i, align 1
   %shr.10.i.i = lshr i32 %conv31.i, 11
   %11 = trunc i32 %shr.10.i.i to i8
   %conv.11.i.i = and i8 %11, 1
-  %arrayidx.i.i7.11.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 11
+  %arrayidx.i.i7.11.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 11
   store i8 %conv.11.i.i, ptr %arrayidx.i.i7.11.i.i, align 1
   %shr.11.i.i = lshr i32 %conv31.i, 12
   %12 = trunc i32 %shr.11.i.i to i8
   %conv.12.i.i = and i8 %12, 1
-  %arrayidx.i.i7.12.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 12
+  %arrayidx.i.i7.12.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 12
   store i8 %conv.12.i.i, ptr %arrayidx.i.i7.12.i.i, align 1
   %shr.12.i.i = lshr i32 %conv31.i, 13
   %13 = trunc i32 %shr.12.i.i to i8
   %conv.13.i.i = and i8 %13, 1
-  %arrayidx.i.i7.13.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 13
+  %arrayidx.i.i7.13.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 13
   store i8 %conv.13.i.i, ptr %arrayidx.i.i7.13.i.i, align 1
   %shr.13.i.i = lshr i32 %conv31.i, 14
   %14 = trunc i32 %shr.13.i.i to i8
   %conv.14.i.i = and i8 %14, 1
-  %arrayidx.i.i7.14.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 14
+  %arrayidx.i.i7.14.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 14
   store i8 %conv.14.i.i, ptr %arrayidx.i.i7.14.i.i, align 1
   %shr.14.i.i = lshr i32 %conv31.i, 15
   %15 = trunc i32 %shr.14.i.i to i8
   %conv.15.i.i = and i8 %15, 1
-  %arrayidx.i.i7.15.i.i = getelementptr inbounds %"struct.std::array", ptr undef, i64 0, i32 0, i64 15
+  %arrayidx.i.i7.15.i.i = getelementptr inbounds %"struct.std::array", ptr %p, i64 0, i32 0, i64 15
   store i8 %conv.15.i.i, ptr %arrayidx.i.i7.15.i.i, align 1
   ret void
 
-if.end50.i:                                       ; preds = %entry
+if.end50.i:
   ret void
 }



More information about the llvm-commits mailing list