-
Notifications
You must be signed in to change notification settings - Fork 394
/
slp_x86.ll
40 lines (38 loc) · 1.77 KB
/
slp_x86.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
33
34
35
36
37
38
39
40
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=slp-vectorizer,dce -slp-threshold=-100 -mtriple=x86_64-unknown-linuxgnu -S %s | FileCheck %s
; The input function can be expressed in C as:
; void foo(int a1, int a2, int b1, int b2, int *A) {
; A[0] = a1*(a1 + b1);
; A[1] = a2*(a2 + b2);
; A[2] = a1*(a1 + b1);
; A[3] = a2*(a2 + b2);
; }
define void @foo(i32, i32, i32, i32, i32* nocapture) local_unnamed_addr #0 {
; CHECK-LABEL: @foo(
; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP2:%.*]], i32 0
; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP3:%.*]], i32 1
; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> poison, i32 [[TMP0:%.*]], i32 0
; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> [[TMP8]], i32 [[TMP1:%.*]], i32 1
; %10 = [a1, a2] + [b1, b2] = [a1 + b1, a2 + b2]
; CHECK-NEXT: [[TMP10:%.*]] = add nsw <2 x i32> [[TMP7]], [[TMP9]]
; %11 = [a1 * (a1 + b1), a2 * (a2 + b2)]
; CHECK-NEXT: [[TMP11:%.*]] = mul nsw <2 x i32> [[TMP10]], [[TMP9]]
; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <2 x i32> [[TMP11]], <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
; A = [shuffle[0], shuffle[1], shuffle[2], shuffle[3]]
; CHECK-NEXT: store <4 x i32> [[TMP12]], ptr [[TMP4:%.*]], align 4
; CHECK-NEXT: ret void
;
%6 = add nsw i32 %2, %0
%7 = mul nsw i32 %6, %0
store i32 %7, i32* %4, align 4
%8 = add nsw i32 %3, %1
%9 = mul nsw i32 %8, %1
%10 = getelementptr inbounds i32, i32* %4, i64 1
store i32 %9, i32* %10, align 4
%11 = getelementptr inbounds i32, i32* %4, i64 2
store i32 %7, i32* %11, align 4
%12 = getelementptr inbounds i32, i32* %4, i64 3
store i32 %9, i32* %12, align 4
ret void
}
attributes #0 = { "target-cpu"="penryn" }