-
Notifications
You must be signed in to change notification settings - Fork 396
/
slp_aarch64.ll
32 lines (26 loc) · 1022 Bytes
/
slp_aarch64.ll
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=slp-vectorizer,dce -slp-threshold=-100 -S -mtriple=aarch64-unknown-linuxgnu %s | FileCheck %s
; The input function can be expressed in C as:
; int hadd(int *a) {
; return a[0] + a[1] + a[2] + a[3]
; }
define i32 @hadd(i32* %a) {
; CHECK-LABEL: @hadd(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, ptr [[A:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> [[TMP0]])
; CHECK-NEXT: ret i32 [[TMP1]]
;
entry:
%0 = load i32, i32* %a, align 4
%arrayidx1 = getelementptr inbounds i32, i32* %a, i32 1
%1 = load i32, i32* %arrayidx1, align 4
%add = add nsw i32 %0, %1
%arrayidx2 = getelementptr inbounds i32, i32* %a, i32 2
%2 = load i32, i32* %arrayidx2, align 4
%add3 = add nsw i32 %add, %2
%arrayidx3 = getelementptr inbounds i32, i32* %a, i32 3
%3 = load i32, i32* %arrayidx3, align 4
%add5 = add nsw i32 %add3, %3
ret i32 %add5
}