File: reduction-same-vals.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (45 lines) | stat: -rw-r--r-- 1,631 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=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:    [[TMP0:%.*]] = insertelement <8 x i32> poison, i32 [[TMP4]], i32 0
; CHECK-NEXT:    [[TMP1:%.*]] = shufflevector <8 x i32> [[TMP0]], <8 x i32> poison, <8 x i32> zeroinitializer
; CHECK-NEXT:    [[TMP2:%.*]] = call i32 @llvm.vector.reduce.mul.v8i32(<8 x i32> [[TMP1]])
; CHECK-NEXT:    [[OP_RDX:%.*]] = mul i32 [[TMP2]], [[TMP4]]
; CHECK-NEXT:    [[OP_RDX1:%.*]] = mul i32 [[TMP4]], [[TMP4]]
; CHECK-NEXT:    [[OP_RDX2:%.*]] = mul i32 [[OP_RDX]], [[OP_RDX1]]
; CHECK-NEXT:    [[OP_RDX3:%.*]] = mul i32 [[OP_RDX2]], [[TMP]]
; CHECK-NEXT:    [[TMP65:%.*]] = sext i32 [[OP_RDX3]] 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
}