[llvm] 96efb21 - [X86] Add regression test for insert_subvector(x,extract_subvector(broadcast)) pattern identified in #133083
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 31 07:01:44 PDT 2025
Author: Simon Pilgrim
Date: 2025-03-31T15:01:31+01:00
New Revision: 96efb21e8865e8f43192979991fdccf08f1a6da4
URL: https://github.com/llvm/llvm-project/commit/96efb21e8865e8f43192979991fdccf08f1a6da4
DIFF: https://github.com/llvm/llvm-project/commit/96efb21e8865e8f43192979991fdccf08f1a6da4.diff
LOG: [X86] Add regression test for insert_subvector(x,extract_subvector(broadcast)) pattern identified in #133083
Infinite loop check
Added:
llvm/test/CodeGen/X86/insert-subvector-broadcast.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/insert-subvector-broadcast.ll b/llvm/test/CodeGen/X86/insert-subvector-broadcast.ll
new file mode 100644
index 0000000000000..47cd752ef80a4
--- /dev/null
+++ b/llvm/test/CodeGen/X86/insert-subvector-broadcast.ll
@@ -0,0 +1,29 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=x86_64-- -mcpu=skx | FileCheck %s
+
+define void @insert_subvector_broadcast_as_blend() {
+; CHECK-LABEL: insert_subvector_broadcast_as_blend:
+; CHECK: # %bb.0:
+; CHECK-NEXT: movq (%rax), %rax
+; CHECK-NEXT: incq %rax
+; CHECK-NEXT: vpbroadcastq %rax, %zmm0
+; CHECK-NEXT: vpslldq {{.*#+}} xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
+; CHECK-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm1
+; CHECK-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm1
+; CHECK-NEXT: vpcmpltq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %zmm1, %k0
+; CHECK-NEXT: vpcmpltq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %zmm0, %k1
+; CHECK-NEXT: kunpckbw %k0, %k1, %k1
+; CHECK-NEXT: vmovdqu8 {{.*#+}} xmm0 {%k1} {z} = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
+; CHECK-NEXT: vmovdqa %xmm0, (%rax)
+; CHECK-NEXT: vzeroupper
+; CHECK-NEXT: retq
+ %load4 = load i64, ptr poison, align 32
+ %add = add i64 %load4, 1
+ %insertelement5 = insertelement <16 x i64> zeroinitializer, i64 %add, i64 1
+ %shufflevector = shufflevector <16 x i64> %insertelement5, <16 x i64> 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>
+ %icmp6 = icmp slt <16 x i64> %shufflevector, <i64 9223372036854775806, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15, i64 16>
+ %shufflevector7 = shufflevector <16 x i1> poison, <16 x i1> %icmp6, <16 x i32> <i32 0, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
+ %zext = zext <16 x i1> %shufflevector7 to <16 x i8>
+ store <16 x i8> %zext, ptr poison, align 32
+ ret void
+}
More information about the llvm-commits
mailing list