[llvm] 7adfa31 - [SLP][NFC]Add a test for reducing same values, NFC.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 19 06:49:14 PDT 2022
Author: Alexey Bataev
Date: 2022-04-19T06:48:21-07:00
New Revision: 7adfa31bc65e44ce65ee47ebe27e61695b34805a
URL: https://github.com/llvm/llvm-project/commit/7adfa31bc65e44ce65ee47ebe27e61695b34805a
DIFF: https://github.com/llvm/llvm-project/commit/7adfa31bc65e44ce65ee47ebe27e61695b34805a.diff
LOG: [SLP][NFC]Add a test for reducing same values, NFC.
Added:
llvm/test/Transforms/SLPVectorizer/X86/reduction-same-vals.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/reduction-same-vals.ll b/llvm/test/Transforms/SLPVectorizer/X86/reduction-same-vals.ll
new file mode 100644
index 0000000000000..6bee995030855
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/reduction-same-vals.ll
@@ -0,0 +1,49 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -slp-vectorizer < %s | FileCheck %s
+
+define i64 @test() {
+; CHECK-LABEL: @test(
+; CHECK-NEXT: bb1:
+; CHECK-NEXT: br label [[BB3:%.*]]
+; CHECK: bb2:
+; CHECK-NEXT: br label [[BB3]]
+; CHECK: bb3:
+; CHECK-NEXT: [[TMP:%.*]] = phi i32 [ 0, [[BB2:%.*]] ], [ 0, [[BB1:%.*]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi i32 [ 0, [[BB2]] ], [ 0, [[BB1]] ]
+; CHECK-NEXT: [[TMP5:%.*]] = mul i32 [[TMP]], [[TMP4]]
+; CHECK-NEXT: [[TMP6:%.*]] = mul i32 [[TMP5]], [[TMP4]]
+; CHECK-NEXT: [[TMP7:%.*]] = mul i32 [[TMP6]], [[TMP4]]
+; CHECK-NEXT: [[TMP8:%.*]] = mul i32 [[TMP7]], [[TMP4]]
+; CHECK-NEXT: [[TMP9:%.*]] = mul i32 [[TMP8]], [[TMP4]]
+; CHECK-NEXT: [[TMP10:%.*]] = mul i32 [[TMP9]], [[TMP4]]
+; CHECK-NEXT: [[TMP11:%.*]] = mul i32 [[TMP10]], [[TMP4]]
+; CHECK-NEXT: [[TMP12:%.*]] = mul i32 [[TMP11]], [[TMP4]]
+; CHECK-NEXT: [[TMP13:%.*]] = mul i32 [[TMP12]], [[TMP4]]
+; CHECK-NEXT: [[TMP14:%.*]] = mul i32 [[TMP13]], [[TMP4]]
+; CHECK-NEXT: [[TMP15:%.*]] = mul i32 [[TMP14]], [[TMP4]]
+; CHECK-NEXT: [[TMP65:%.*]] = sext i32 [[TMP15]] to i64
+; CHECK-NEXT: ret i64 [[TMP65]]
+;
+bb1:
+ br label %bb3
+
+bb2:
+ br label %bb3
+
+bb3:
+ %tmp = phi i32 [ 0, %bb2 ], [ 0, %bb1 ]
+ %tmp4 = phi i32 [ 0, %bb2 ], [ 0, %bb1 ]
+ %tmp5 = mul i32 %tmp, %tmp4
+ %tmp6 = mul i32 %tmp5, %tmp4
+ %tmp7 = mul i32 %tmp6, %tmp4
+ %tmp8 = mul i32 %tmp7, %tmp4
+ %tmp9 = mul i32 %tmp8, %tmp4
+ %tmp10 = mul i32 %tmp9, %tmp4
+ %tmp11 = mul i32 %tmp10, %tmp4
+ %tmp12 = mul i32 %tmp11, %tmp4
+ %tmp13 = mul i32 %tmp12, %tmp4
+ %tmp14 = mul i32 %tmp13, %tmp4
+ %tmp15 = mul i32 %tmp14, %tmp4
+ %tmp65 = sext i32 %tmp15 to i64
+ ret i64 %tmp65
+}
More information about the llvm-commits
mailing list