1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=x86_64-- -mcpu=corei7 -pass-remarks-output=%t | FileCheck %s
3 ; RUN: FileCheck %s --input-file=%t --check-prefix=YAML
4 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
6 ; YAML-LABEL: --- !Passed
7 ; YAML-NEXT: Pass: slp-vectorizer
8 ; YAML-NEXT: Name: VectorizedList
9 ; YAML-NEXT: Function: foo
11 ; YAML-NEXT: - String: 'SLP vectorized with cost '
12 ; YAML-NEXT: - Cost: '-4'
13 ; YAML-NEXT: - String: ' and with tree size '
14 ; YAML-NEXT: - TreeSize: '10'
18 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr null, align 4
19 ; CHECK-NEXT: br i1 false, label [[TMP11:%.*]], label [[TMP2:%.*]]
21 ; CHECK-NEXT: [[TMP3:%.*]] = insertelement <2 x float> <float undef, float 0.000000e+00>, float [[TMP1]], i32 0
22 ; CHECK-NEXT: [[TMP4:%.*]] = fadd <2 x float> [[TMP3]], zeroinitializer
23 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x float> [[TMP4]], <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
24 ; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <2 x float> [[TMP3]], <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
25 ; CHECK-NEXT: [[TMP7:%.*]] = select <4 x i1> zeroinitializer, <4 x float> [[TMP5]], <4 x float> [[TMP6]]
26 ; CHECK-NEXT: [[TMP8:%.*]] = fadd <4 x float> [[TMP7]], zeroinitializer
27 ; CHECK-NEXT: [[TMP9:%.*]] = fsub <4 x float> [[TMP7]], zeroinitializer
28 ; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <4 x float> [[TMP8]], <4 x float> [[TMP9]], <4 x i32> <i32 0, i32 1, i32 6, i32 7>
29 ; CHECK-NEXT: br label [[TMP11]]
31 ; CHECK-NEXT: [[TMP12:%.*]] = phi <4 x float> [ [[TMP10]], [[TMP2]] ], [ zeroinitializer, [[TMP0:%.*]] ]
32 ; CHECK-NEXT: ret i1 false
34 %1 = load float, ptr null, align 4
35 br i1 false, label %14, label %2
38 %3 = extractelement <4 x float> zeroinitializer, i64 0
39 %4 = fadd float %1, 0.000000e+00
40 %5 = fadd float %3, 0.000000e+00
41 %6 = select i1 false, float %4, float %1
42 %7 = fsub float %6, 0.000000e+00
43 %8 = select i1 false, float %5, float %3
44 %9 = fsub float %8, 0.000000e+00
45 %10 = select i1 false, float %4, float %1
46 %11 = fadd float 0.000000e+00, %10
47 %12 = select i1 false, float %5, float %3
48 %13 = fadd float 0.000000e+00, %12
52 %15 = phi float [ %7, %2 ], [ 0.000000e+00, %0 ]
53 %16 = phi float [ %9, %2 ], [ 0.000000e+00, %0 ]
54 %17 = phi float [ %11, %2 ], [ 0.000000e+00, %0 ]
55 %18 = phi float [ %13, %2 ], [ 0.000000e+00, %0 ]