[llvm] 0dca7ee - [SLP][NFC]Add a test with the incorrect minbitwidth in alternate nodes, NFC
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 31 13:19:11 PDT 2025
Author: Alexey Bataev
Date: 2025-10-31T13:19:02-07:00
New Revision: 0dca7ee4480f11cd0230d316ccc5d2c7234a4b31
URL: https://github.com/llvm/llvm-project/commit/0dca7ee4480f11cd0230d316ccc5d2c7234a4b31
DIFF: https://github.com/llvm/llvm-project/commit/0dca7ee4480f11cd0230d316ccc5d2c7234a4b31.diff
LOG: [SLP][NFC]Add a test with the incorrect minbitwidth in alternate nodes, NFC
Added:
llvm/test/Transforms/SLPVectorizer/X86/alternate-opcode-strict-bitwidth-than-main.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/alternate-opcode-strict-bitwidth-than-main.ll b/llvm/test/Transforms/SLPVectorizer/X86/alternate-opcode-strict-bitwidth-than-main.ll
new file mode 100644
index 0000000000000..959b2350d9d78
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/alternate-opcode-strict-bitwidth-than-main.ll
@@ -0,0 +1,36 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt -passes=slp-vectorizer -S -slp-threshold=-99999 -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
+
+define float @test(i8 %0) {
+; CHECK-LABEL: define float @test(
+; CHECK-SAME: i8 [[TMP0:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i8> <i8 poison, i8 0>, i8 [[TMP0]], i32 0
+; CHECK-NEXT: [[TMP2:%.*]] = sext <2 x i8> [[TMP1]] to <2 x i32>
+; CHECK-NEXT: [[TMP3:%.*]] = mul <2 x i32> [[TMP2]], <i32 2, i32 27>
+; CHECK-NEXT: [[TMP4:%.*]] = lshr <2 x i32> [[TMP2]], <i32 2, i32 27>
+; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x i32> [[TMP3]], <2 x i32> [[TMP4]], <2 x i32> <i32 0, i32 3>
+; CHECK-NEXT: [[TMP6:%.*]] = extractelement <2 x i32> [[TMP5]], i32 0
+; CHECK-NEXT: [[TMP7:%.*]] = extractelement <2 x i32> [[TMP5]], i32 1
+; CHECK-NEXT: [[TMP8:%.*]] = or i32 [[TMP6]], [[TMP7]]
+; CHECK-NEXT: switch i32 [[TMP8]], label %[[EXIT:.*]] [
+; CHECK-NEXT: i32 0, label %[[EXIT]]
+; CHECK-NEXT: i32 1, label %[[EXIT]]
+; CHECK-NEXT: ]
+; CHECK: [[EXIT]]:
+; CHECK-NEXT: ret float 0.000000e+00
+;
+entry:
+ %1 = sext i8 0 to i32
+ %2 = lshr i32 %1, 27
+ %3 = sext i8 %0 to i32
+ %reass.add.epil = mul i32 %3, 2
+ %4 = or i32 %reass.add.epil, %2
+ switch i32 %4, label %exit [
+ i32 0, label %exit
+ i32 1, label %exit
+ ]
+
+exit:
+ ret float 0.000000e+00
+}
More information about the llvm-commits
mailing list