1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux -pass-remarks-output=%t -mattr=+v -slp-threshold=-10 < %s | FileCheck %s
3 ; RUN: FileCheck %s --check-prefix=YAML < %t
5 ; YAML-LABEL: --- !Passed
6 ; YAML-NEXT: Pass: slp-vectorizer
7 ; YAML-NEXT: Name: StoresVectorized
8 ; YAML-NEXT: Function: test
10 ; YAML-NEXT: - String: 'Stores SLP vectorized with cost '
11 ; YAML-NEXT: - Cost: '3'
12 ; YAML-NEXT: - String: ' and with tree size '
13 ; YAML-NEXT: - TreeSize: '7'
16 ; CHECK-LABEL: define void @test(
17 ; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
19 ; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr null, align 4
20 ; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr null, align 4
21 ; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr null, align 4
22 ; CHECK-NEXT: [[TMP3:%.*]] = insertelement <2 x float> <float poison, float 0.000000e+00>, float [[TMP1]], i32 0
23 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x float> poison, float [[TMP0]], i32 0
24 ; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x float> [[TMP4]], float [[TMP2]], i32 1
25 ; CHECK-NEXT: [[TMP6:%.*]] = fcmp ogt <2 x float> [[TMP3]], [[TMP5]]
26 ; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <2 x i1> [[TMP6]], <2 x i1> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
27 ; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <2 x float> [[TMP5]], <2 x float> [[TMP3]], <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
28 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <4 x float> [[TMP8]], <4 x float> <float poison, float poison, float poison, float 0.000000e+00>, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
29 ; CHECK-NEXT: [[TMP10:%.*]] = select <4 x i1> [[TMP7]], <4 x float> [[TMP9]], <4 x float> zeroinitializer
30 ; CHECK-NEXT: store <4 x float> [[TMP10]], ptr null, align 4
31 ; CHECK-NEXT: ret void
34 %0 = load float, ptr null, align 4
35 %1 = load float, ptr null, align 4
36 %2 = load float, ptr null, align 4
37 %cmp.i = fcmp ogt float %1, %0
38 %v14.0 = select i1 %cmp.i, float %1, float 0.000000e+00
39 %v0.0 = select i1 %cmp.i, float %0, float 0.000000e+00
40 %cmp4.i = fcmp ogt float 0.000000e+00, %2
41 %v19.0 = select i1 %cmp4.i, float 0.000000e+00, float 0.000000e+00
42 %v9.0 = select i1 %cmp4.i, float %2, float 0.000000e+00
43 store float %v0.0, ptr null, align 4
44 %v9idx = getelementptr i8, ptr null, i32 4
45 store float %v9.0, ptr %v9idx, align 4
46 %v14idx = getelementptr i8, ptr null, i32 8
47 store float %v14.0, ptr %v14idx, align 4
48 %v19idx = getelementptr i8, ptr null, i32 12
49 store float %v19.0, ptr %v19idx, align 4