File: slp-or-reduction.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (63 lines) | stat: -rw-r--r-- 2,872 bytes parent folder | download | duplicates (12)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -S -mtriple=aarch64 -passes=slp-vectorizer | FileCheck %s

%struct.buf = type { [8 x i8] }

define i8 @reduce_or(ptr %a, ptr %b) {
; CHECK-LABEL: @reduce_or(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[TMP1:%.*]] = load <8 x i8>, ptr [[A:%.*]], align 1
; CHECK-NEXT:    [[TMP3:%.*]] = load <8 x i8>, ptr [[B:%.*]], align 1
; CHECK-NEXT:    [[TMP4:%.*]] = xor <8 x i8> [[TMP3]], [[TMP1]]
; CHECK-NEXT:    [[TMP5:%.*]] = call i8 @llvm.vector.reduce.or.v8i8(<8 x i8> [[TMP4]])
; CHECK-NEXT:    ret i8 [[TMP5]]
;

entry:
  %0 = load i8, ptr %a, align 1
  %1 = load i8, ptr %b, align 1
  %xor12 = xor i8 %1, %0
  %arrayidx.1 = getelementptr inbounds %struct.buf, ptr %a, i64 0, i32 0, i64 1
  %2 = load i8, ptr %arrayidx.1, align 1
  %arrayidx3.1 = getelementptr inbounds %struct.buf, ptr %b, i64 0, i32 0, i64 1
  %3 = load i8, ptr %arrayidx3.1, align 1
  %xor12.1 = xor i8 %3, %2
  %or13.1 = or i8 %xor12.1, %xor12
  %arrayidx.2 = getelementptr inbounds %struct.buf, ptr %a, i64 0, i32 0, i64 2
  %4 = load i8, ptr %arrayidx.2, align 1
  %arrayidx3.2 = getelementptr inbounds %struct.buf, ptr %b, i64 0, i32 0, i64 2
  %5 = load i8, ptr %arrayidx3.2, align 1
  %xor12.2 = xor i8 %5, %4
  %or13.2 = or i8 %xor12.2, %or13.1
  %arrayidx.3 = getelementptr inbounds %struct.buf, ptr %a, i64 0, i32 0, i64 3
  %6 = load i8, ptr %arrayidx.3, align 1
  %arrayidx3.3 = getelementptr inbounds %struct.buf, ptr %b, i64 0, i32 0, i64 3
  %7 = load i8, ptr %arrayidx3.3, align 1
  %xor12.3 = xor i8 %7, %6
  %or13.3 = or i8 %xor12.3, %or13.2
  %arrayidx.4 = getelementptr inbounds %struct.buf, ptr %a, i64 0, i32 0, i64 4
  %8 = load i8, ptr %arrayidx.4, align 1
  %arrayidx3.4 = getelementptr inbounds %struct.buf, ptr %b, i64 0, i32 0, i64 4
  %9 = load i8, ptr %arrayidx3.4, align 1
  %xor12.4 = xor i8 %9, %8
  %or13.4 = or i8 %xor12.4, %or13.3
  %arrayidx.5 = getelementptr inbounds %struct.buf, ptr %a, i64 0, i32 0, i64 5
  %10 = load i8, ptr %arrayidx.5, align 1
  %arrayidx3.5 = getelementptr inbounds %struct.buf, ptr %b, i64 0, i32 0, i64 5
  %11 = load i8, ptr %arrayidx3.5, align 1
  %xor12.5 = xor i8 %11, %10
  %or13.5 = or i8 %xor12.5, %or13.4
  %arrayidx.6 = getelementptr inbounds %struct.buf, ptr %a, i64 0, i32 0, i64 6
  %12 = load i8, ptr %arrayidx.6, align 1
  %arrayidx3.6 = getelementptr inbounds %struct.buf, ptr %b, i64 0, i32 0, i64 6
  %13 = load i8, ptr %arrayidx3.6, align 1
  %xor12.6 = xor i8 %13, %12
  %or13.6 = or i8 %xor12.6, %or13.5
  %arrayidx.7 = getelementptr inbounds %struct.buf, ptr %a, i64 0, i32 0, i64 7
  %14 = load i8, ptr %arrayidx.7, align 1
  %arrayidx3.7 = getelementptr inbounds %struct.buf, ptr %b, i64 0, i32 0, i64 7
  %15 = load i8, ptr %arrayidx3.7, align 1
  %xor12.7 = xor i8 %15, %14
  %or13.7 = or i8 %xor12.7, %or13.6
  ret i8 %or13.7
}