Skip to content

Commit

Permalink
[SLP][NFC]Add a test for reducing same values, NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-bataev committed Apr 19, 2022
1 parent 8835719 commit 7adfa31
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions llvm/test/Transforms/SLPVectorizer/X86/reduction-same-vals.ll
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 7adfa31

Please sign in to comment.