73 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=x86_64-unknown -mcpu=corei7-avx | FileCheck %s3 4%struct.complex = type { float, float }5 6define void @foo (ptr %A, ptr %B, ptr %Result) {7; CHECK-LABEL: @foo(8; CHECK-NEXT: entry:9; CHECK-NEXT: [[TMP0:%.*]] = add i64 256, 010; CHECK-NEXT: br label [[LOOP:%.*]]11; CHECK: loop:12; CHECK-NEXT: [[TMP1:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[TMP18:%.*]], [[LOOP]] ]13; CHECK-NEXT: [[TMP2:%.*]] = phi <2 x float> [ zeroinitializer, [[ENTRY]] ], [ [[TMP20:%.*]], [[LOOP]] ]14; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT_COMPLEX:%.*]], ptr [[A:%.*]], i64 [[TMP1]], i32 015; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT_COMPLEX]], ptr [[B:%.*]], i64 [[TMP1]], i32 016; CHECK-NEXT: [[TMP5:%.*]] = load float, ptr [[TMP4]], align 417; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT_COMPLEX]], ptr [[B]], i64 [[TMP1]], i32 118; CHECK-NEXT: [[TMP7:%.*]] = load float, ptr [[TMP6]], align 419; CHECK-NEXT: [[TMP8:%.*]] = load <2 x float>, ptr [[TMP3]], align 420; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x float> poison, float [[TMP5]], i32 021; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <2 x float> [[TMP9]], <2 x float> poison, <2 x i32> zeroinitializer22; CHECK-NEXT: [[TMP11:%.*]] = fmul <2 x float> [[TMP8]], [[TMP10]]23; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x float> poison, float [[TMP7]], i32 024; CHECK-NEXT: [[TMP13:%.*]] = shufflevector <2 x float> [[TMP12]], <2 x float> poison, <2 x i32> zeroinitializer25; CHECK-NEXT: [[TMP14:%.*]] = fmul <2 x float> [[TMP8]], [[TMP13]]26; CHECK-NEXT: [[TMP15:%.*]] = shufflevector <2 x float> [[TMP14]], <2 x float> poison, <2 x i32> <i32 1, i32 0>27; CHECK-NEXT: [[TMP16:%.*]] = fsub <2 x float> [[TMP11]], [[TMP15]]28; CHECK-NEXT: [[TMP17:%.*]] = fadd <2 x float> [[TMP11]], [[TMP15]]29; CHECK-NEXT: [[TMP21:%.*]] = shufflevector <2 x float> [[TMP16]], <2 x float> [[TMP17]], <2 x i32> <i32 0, i32 3>30; CHECK-NEXT: [[TMP20]] = fadd <2 x float> [[TMP2]], [[TMP21]]31; CHECK-NEXT: [[TMP18]] = add nuw nsw i64 [[TMP1]], 132; CHECK-NEXT: [[TMP19:%.*]] = icmp eq i64 [[TMP18]], [[TMP0]]33; CHECK-NEXT: br i1 [[TMP19]], label [[EXIT:%.*]], label [[LOOP]]34; CHECK: exit:35; CHECK-NEXT: store <2 x float> [[TMP20]], ptr [[RESULT:%.*]], align 436; CHECK-NEXT: ret void37;38entry:39 %0 = add i64 256, 040 br label %loop41 42loop:43 %1 = phi i64 [ 0, %entry ], [ %20, %loop ]44 %2 = phi float [ 0.000000e+00, %entry ], [ %19, %loop ]45 %3 = phi float [ 0.000000e+00, %entry ], [ %18, %loop ]46 %4 = getelementptr inbounds %"struct.complex", ptr %A, i64 %1, i32 047 %5 = load float, ptr %4, align 448 %6 = getelementptr inbounds %"struct.complex", ptr %A, i64 %1, i32 149 %7 = load float, ptr %6, align 450 %8 = getelementptr inbounds %"struct.complex", ptr %B, i64 %1, i32 051 %9 = load float, ptr %8, align 452 %10 = getelementptr inbounds %"struct.complex", ptr %B, i64 %1, i32 153 %11 = load float, ptr %10, align 454 %12 = fmul float %5, %955 %13 = fmul float %7, %1156 %14 = fsub float %12, %1357 %15 = fmul float %7, %958 %16 = fmul float %5, %1159 %17 = fadd float %15, %1660 %18 = fadd float %3, %1461 %19 = fadd float %2, %1762 %20 = add nuw nsw i64 %1, 163 %21 = icmp eq i64 %20, %064 br i1 %21, label %exit, label %loop65 66exit:67 store float %18, ptr %Result, align 468 %22 = getelementptr inbounds %"struct.complex", ptr %Result, i32 0, i32 169 store float %19, ptr %22, align 470 ret void71}72 73