[llvm] [SLP][NFC]Remove undefs, NFC (PR #207518)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 4 09:05:56 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Alexey Bataev (alexey-bataev)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/207518.diff


1 Files Affected:

- (modified) llvm/test/Transforms/SLPVectorizer/X86/buildvector-shuffle.ll (+23-15) 


``````````diff
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/buildvector-shuffle.ll b/llvm/test/Transforms/SLPVectorizer/X86/buildvector-shuffle.ll
index 519f38a8c9718..9d0c980ac98a1 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/buildvector-shuffle.ll
+++ b/llvm/test/Transforms/SLPVectorizer/X86/buildvector-shuffle.ll
@@ -1,41 +1,49 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt -S -passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
 
-define void @b() {
+define void @b(float %a, ptr %b) {
 ; CHECK-LABEL: @b(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <4 x float> poison, float +qnan, i32 0
-; CHECK-NEXT:    [[TMP1:%.*]] = shufflevector <4 x float> [[TMP0]], <4 x float> <float -qnan, float -qnan, float undef, float undef>, <4 x i32> <i32 0, i32 4, i32 5, i32 poison>
-; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <4 x float> [[TMP1]], float +qnan, i32 3
+; CHECK-NEXT:    [[MUL:%.*]] = fmul float [[A:%.*]], 2.000000e+00
+; CHECK-NEXT:    [[ADD:%.*]] = fadd float [[A]], 1.000000e+00
+; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x float> poison, float [[ADD]], i32 0
+; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x float> [[TMP0]], float [[MUL]], i32 1
+; CHECK-NEXT:    [[TMP6:%.*]] = fneg <2 x float> [[TMP1]]
+; CHECK-NEXT:    [[TMP7:%.*]] = insertelement <4 x float> poison, float [[MUL]], i32 0
+; CHECK-NEXT:    [[TMP10:%.*]] = shufflevector <2 x float> [[TMP6]], <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
+; CHECK-NEXT:    [[TMP11:%.*]] = shufflevector <4 x float> [[TMP7]], <4 x float> [[TMP10]], <4 x i32> <i32 0, i32 4, i32 5, i32 poison>
+; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <4 x float> [[TMP11]], float [[ADD]], i32 3
 ; CHECK-NEXT:    [[TMP3:%.*]] = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> [[TMP2]], <4 x float> zeroinitializer, <4 x float> zeroinitializer)
-; CHECK-NEXT:    [[TMP4:%.*]] = fmul <4 x float> [[TMP3]], <float undef, float undef, float undef, float 2.000000e+00>
+; CHECK-NEXT:    [[TMP8:%.*]] = insertelement <4 x float> <float poison, float 2.000000e+00, float poison, float poison>, float [[A]], i32 0
+; CHECK-NEXT:    [[TMP9:%.*]] = shufflevector <4 x float> [[TMP8]], <4 x float> poison, <4 x i32> <i32 0, i32 0, i32 0, i32 1>
+; CHECK-NEXT:    [[TMP4:%.*]] = fmul <4 x float> [[TMP3]], [[TMP9]]
 ; CHECK-NEXT:    [[TMP5:%.*]] = fdiv <4 x float> [[TMP4]], zeroinitializer
-; CHECK-NEXT:    store <4 x float> [[TMP5]], ptr undef, align 4
+; CHECK-NEXT:    store <4 x float> [[TMP5]], ptr [[B:%.*]], align 4
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  %mul = fmul float undef, 2.000000e+00
+  %mul = fmul float %a, 2.000000e+00
   %i = tail call float @llvm.fmuladd.f32(float %mul, float 0.000000e+00, float 0.000000e+00)
-  %mul2 = fmul float undef, %i
-  %add = fadd float undef, 1.000000e+00
+  %mul2 = fmul float %a, %i
+  %add = fadd float %a, 1.000000e+00
   %neg = fneg float %add
   %i1 = tail call float @llvm.fmuladd.f32(float %neg, float 0.000000e+00, float 0.000000e+00)
-  %mul4 = fmul float undef, %i1
+  %mul4 = fmul float %a, %i1
   %neg7 = fneg float %mul
   %i2 = tail call float @llvm.fmuladd.f32(float %neg7, float 0.000000e+00, float 0.000000e+00)
-  %mul8 = fmul float undef, %i2
+  %mul8 = fmul float %a, %i2
   %i3 = tail call float @llvm.fmuladd.f32(float %add, float 0.000000e+00, float 0.000000e+00)
   %mul11 = fmul float %i3, 2.000000e+00
   %div = fdiv float %mul2, 0.000000e+00
-  store float %div, ptr undef, align 4
+  store float %div, ptr %b, align 4
   %div12 = fdiv float %mul4, 0.000000e+00
-  %arrayidx13 = getelementptr inbounds float, ptr undef, i64 1
+  %arrayidx13 = getelementptr inbounds float, ptr %b, i64 1
   store float %div12, ptr %arrayidx13, align 4
   %div14 = fdiv float %mul8, 0.000000e+00
-  %arrayidx15 = getelementptr inbounds float, ptr undef, i64 2
+  %arrayidx15 = getelementptr inbounds float, ptr %b, i64 2
   store float %div14, ptr %arrayidx15, align 4
   %div16 = fdiv float %mul11, 0.000000e+00
-  %arrayidx17 = getelementptr inbounds float, ptr undef, i64 3
+  %arrayidx17 = getelementptr inbounds float, ptr %b, i64 3
   store float %div16, ptr %arrayidx17, align 4
   ret void
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/207518


More information about the llvm-commits mailing list