| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 | |
| ; RUN: opt -S --passes=sroa,slp-vectorizer < %s | FileCheck %s | |
| define float @test(<2 x float> %v) { | |
| ; CHECK-LABEL: define float @test( | |
| ; CHECK-SAME: <2 x float> [[V:%.*]]) { | |
| ; CHECK-NEXT: [[ENTRY:.*:]] | |
| ; CHECK-NEXT: [[TMP0:%.*]] = shufflevector <2 x float> [[V]], <2 x float> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison> | |
| ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <4 x float> [[TMP0]], <4 x float> <float poison, float undef, float undef, float undef>, <4 x i32> <i32 0, i32 5, i32 6, i32 7> | |
| ; CHECK-NEXT: [[TMP2:%.*]] = call float @llvm.vector.reduce.fadd.v4f32(float -0.000000e+00, <4 x float> [[TMP1]]) | |
| ; CHECK-NEXT: ret float [[TMP2]] | |
| ; | |
| entry: | |
| %u.addr = alloca float, align 4 | |
| %u = load float, ptr %u.addr, align 4 | |
| %x = extractelement <2 x float> %v, i64 0 | |
| %a1 = fadd float %x, %u | |
| %a2 = fadd float %a1, %u | |
| %a3 = fadd float %a2, %u | |
| ret float %a3 | |
| } |