1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -passes=slp-vectorizer -S < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=skylake -slp-threshold=-10 | FileCheck %s
4 define double @test01() {
5 ; CHECK-LABEL: define double @test01
6 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
7 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i32>, ptr null, align 8
8 ; CHECK-NEXT: [[TMP2:%.*]] = getelementptr double, <2 x ptr> zeroinitializer, <2 x i32> [[TMP1]]
9 ; CHECK-NEXT: [[TMP3:%.*]] = call <2 x double> @llvm.masked.gather.v2f64.v2p0(<2 x ptr> [[TMP2]], i32 8, <2 x i1> <i1 true, i1 true>, <2 x double> poison)
10 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <2 x double> [[TMP3]], <2 x double> <double 0.000000e+00, double poison>, <2 x i32> <i32 2, i32 0>
11 ; CHECK-NEXT: [[TMP5:%.*]] = fadd <2 x double> [[TMP4]], [[TMP4]]
12 ; CHECK-NEXT: [[TMP6:%.*]] = fadd <2 x double> [[TMP3]], [[TMP5]]
13 ; CHECK-NEXT: [[TMP7:%.*]] = extractelement <2 x double> [[TMP6]], i32 0
14 ; CHECK-NEXT: [[TMP8:%.*]] = extractelement <2 x double> [[TMP6]], i32 1
15 ; CHECK-NEXT: [[TMP9:%.*]] = fadd double [[TMP7]], [[TMP8]]
16 ; CHECK-NEXT: ret double [[TMP9]]
18 %1 = load i32, ptr null, align 8
19 %2 = load i32, ptr getelementptr inbounds (i32, ptr null, i32 1), align 4
20 %3 = getelementptr double, ptr null, i32 %2
21 %4 = load double, ptr %3, align 8
22 %5 = getelementptr double, ptr null, i32 %1
23 %6 = load double, ptr %5, align 8
24 %7 = fadd double %6, %6
25 %8 = fadd double %4, %7
26 %9 = fadd double 0.000000e+00, 0.000000e+00
27 %10 = fadd double %6, %9
28 %11 = fadd double %10, %8