[llvm] 538dbb9 - [SLP][NFC]Add a test with the operand reordering and bad reused values decision
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 13:56:39 PDT 2024
Author: Alexey Bataev
Date: 2024-09-24T13:54:43-07:00
New Revision: 538dbb97a215d4f203cb1e88455bd10a1ecd7e7d
URL: https://github.com/llvm/llvm-project/commit/538dbb97a215d4f203cb1e88455bd10a1ecd7e7d
DIFF: https://github.com/llvm/llvm-project/commit/538dbb97a215d4f203cb1e88455bd10a1ecd7e7d.diff
LOG: [SLP][NFC]Add a test with the operand reordering and bad reused values decision
Added:
llvm/test/Transforms/SLPVectorizer/X86/splat-score-adjustment.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/splat-score-adjustment.ll b/llvm/test/Transforms/SLPVectorizer/X86/splat-score-adjustment.ll
new file mode 100644
index 00000000000000..9691cb7537a702
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/splat-score-adjustment.ll
@@ -0,0 +1,95 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu -mcpu=core-avx2 < %s | FileCheck %s
+
+define i32 @a() {
+; CHECK-LABEL: define i32 @a(
+; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: br label %[[BB1:.*]]
+; CHECK: [[BB1]]:
+; CHECK-NEXT: [[TMP2:%.*]] = phi i8 [ 0, [[TMP0:%.*]] ], [ [[TMP7:%.*]], %[[BB1]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi i8 [ 0, [[TMP0]] ], [ [[TMP8:%.*]], %[[BB1]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi <4 x i8> [ zeroinitializer, [[TMP0]] ], [ [[TMP6:%.*]], %[[BB1]] ]
+; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x i8> [[TMP4]], <4 x i8> poison, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
+; CHECK-NEXT: [[TMP6]] = load <4 x i8>, ptr null, align 4
+; CHECK-NEXT: [[TMP7]] = extractelement <4 x i8> [[TMP6]], i32 3
+; CHECK-NEXT: [[TMP8]] = extractelement <4 x i8> [[TMP6]], i32 2
+; CHECK-NEXT: [[TMP9:%.*]] = extractelement <4 x i8> [[TMP6]], i32 0
+; CHECK-NEXT: [[TMP10:%.*]] = xor i8 [[TMP9]], [[TMP3]]
+; CHECK-NEXT: [[TMP11:%.*]] = extractelement <4 x i8> [[TMP6]], i32 1
+; CHECK-NEXT: [[TMP12:%.*]] = xor i8 [[TMP11]], [[TMP2]]
+; CHECK-NEXT: [[TMP13:%.*]] = xor i8 [[TMP8]], [[TMP9]]
+; CHECK-NEXT: [[TMP14:%.*]] = xor i8 [[TMP7]], [[TMP11]]
+; CHECK-NEXT: [[TMP15:%.*]] = shufflevector <4 x i8> [[TMP6]], <4 x i8> poison, <8 x i32> <i32 poison, i32 0, i32 poison, i32 1, i32 poison, i32 2, i32 0, i32 3>
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <8 x i8> [[TMP15]], i8 [[TMP10]], i32 0
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <8 x i8> [[TMP16]], i8 [[TMP12]], i32 2
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <8 x i8> [[TMP17]], i8 [[TMP13]], i32 4
+; CHECK-NEXT: [[TMP19:%.*]] = shufflevector <4 x i8> [[TMP4]], <4 x i8> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>
+; CHECK-NEXT: [[TMP20:%.*]] = shufflevector <8 x i8> [[TMP19]], <8 x i8> [[TMP18]], <8 x i32> <i32 1, i32 3, i32 2, i32 9, i32 3, i32 11, i32 poison, i32 13>
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <8 x i8> [[TMP20]], i8 [[TMP14]], i32 6
+; CHECK-NEXT: [[TMP22:%.*]] = xor <8 x i8> [[TMP18]], [[TMP21]]
+; CHECK-NEXT: [[TMP23:%.*]] = xor <8 x i8> [[TMP22]], [[TMP5]]
+; CHECK-NEXT: store <8 x i8> [[TMP23]], ptr null, align 4
+; CHECK-NEXT: br label %[[BB1]]
+;
+ br label %1
+
+1:
+ %2 = phi i8 [ 0, %0 ], [ %40, %1 ]
+ %3 = phi i8 [ 0, %0 ], [ %28, %1 ]
+ %4 = phi i8 [ 0, %0 ], [ %16, %1 ]
+ %5 = phi i8 [ 0, %0 ], [ %6, %1 ]
+ %6 = load i8, ptr null, align 4
+ %7 = xor i8 %6, %3
+ %8 = xor i8 %7, %4
+ %9 = xor i8 %8, %5
+ store i8 %9, ptr null, align 4
+ %10 = xor i8 %6, %2
+ %11 = xor i8 %10, %5
+ %12 = add i64 0, 1
+ %13 = getelementptr i8, ptr null, i64 %12
+ store i8 %11, ptr %13, align 1
+ %14 = add i64 0, 1
+ %15 = getelementptr i8, ptr null, i64 %14
+ %16 = load i8, ptr %15, align 1
+ %17 = xor i8 %16, %2
+ %18 = xor i8 %17, %3
+ %19 = xor i8 %18, %4
+ %20 = add i64 0, 2
+ %21 = getelementptr i8, ptr null, i64 %20
+ store i8 %19, ptr %21, align 2
+ %22 = xor i8 %16, %6
+ %23 = xor i8 %22, %4
+ %24 = add i64 0, 3
+ %25 = getelementptr i8, ptr null, i64 %24
+ store i8 %23, ptr %25, align 1
+ %26 = add i64 0, 2
+ %27 = getelementptr i8, ptr null, i64 %26
+ %28 = load i8, ptr %27, align 2
+ %29 = xor i8 %28, %6
+ %30 = xor i8 %29, %2
+ %31 = xor i8 %30, %3
+ %32 = add i64 0, 4
+ %33 = getelementptr i8, ptr null, i64 %32
+ store i8 %31, ptr %33, align 4
+ %34 = xor i8 %28, %16
+ %35 = xor i8 %34, %3
+ %36 = add i64 0, 5
+ %37 = getelementptr i8, ptr null, i64 %36
+ store i8 %35, ptr %37, align 1
+ %38 = add i64 0, 3
+ %39 = getelementptr i8, ptr null, i64 %38
+ %40 = load i8, ptr %39, align 1
+ %41 = xor i8 %40, %16
+ %42 = xor i8 %41, %6
+ %43 = xor i8 %42, %2
+ %44 = add i64 0, 6
+ %45 = getelementptr i8, ptr null, i64 %44
+ store i8 %43, ptr %45, align 2
+ %46 = xor i8 %40, %28
+ %47 = xor i8 %46, %2
+ %48 = add i64 0, 7
+ %49 = getelementptr i8, ptr null, i64 %48
+ store i8 %47, ptr %49, align 1
+ br label %1
+}
+
More information about the llvm-commits
mailing list