57 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -vectorizer-maximize-bandwidth -mtriple=powerpc64le-- -S \3; RUN: -passes=loop-simplify,loop-rotate,loop-vectorize,instcombine,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -force-vector-interleave=1 < %s | FileCheck %s4define dso_local double @test(ptr %Arr) {5; CHECK-LABEL: @test(6; CHECK-NEXT: entry:7; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]8; CHECK: vector.body:9; CHECK-NEXT: [[INDEX:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]10; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <2 x double> [ zeroinitializer, [[ENTRY]] ], [ [[TMP4:%.*]], [[VECTOR_BODY]] ]11; CHECK-NEXT: [[TMP0:%.*]] = sext i32 [[INDEX]] to i6412; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds float, ptr [[ARR:%.*]], i64 [[TMP0]]13; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <2 x float>, ptr [[TMP1]], align 414; CHECK-NEXT: [[TMP2:%.*]] = fpext <2 x float> [[WIDE_LOAD]] to <2 x double>15; CHECK-NEXT: [[TMP3:%.*]] = call fast <2 x double> @__sind2_P8(<2 x double> [[TMP2]])16; CHECK-NEXT: [[TMP4]] = fadd fast <2 x double> [[VEC_PHI]], [[TMP3]]17; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i32 [[INDEX]], 218; CHECK-NEXT: [[TMP5:%.*]] = icmp eq i32 [[INDEX_NEXT]], 12819; CHECK-NEXT: br i1 [[TMP5]], label [[FOR_END:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]20; CHECK: for.end:21; CHECK-NEXT: [[TMP6:%.*]] = call fast double @llvm.vector.reduce.fadd.v2f64(double 0.000000e+00, <2 x double> [[TMP4]])22; CHECK-NEXT: ret double [[TMP6]]23;24entry:25 br label %for.cond26 27for.cond:28 %Sum.0 = phi double [ 0.000000e+00, %entry ], [ %add, %for.inc ]29 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]30 %cmp = icmp slt i32 %i.0, 12831 br i1 %cmp, label %for.body, label %for.cond.cleanup32 33for.cond.cleanup:34 br label %for.end35 36for.body:37 %idxprom = sext i32 %i.0 to i6438 %arrayidx = getelementptr inbounds float, ptr %Arr, i64 %idxprom39 %0 = load float, ptr %arrayidx, align 440 %conv = fpext float %0 to double41 %1 = call fast double @llvm.sin.f64(double %conv) #142 %add = fadd fast double %Sum.0, %143 br label %for.inc44 45for.inc:46 %inc = add nsw i32 %i.0, 147 br label %for.cond48 49for.end:50 ret double %Sum.051}52 53declare double @llvm.sin.f64(double) #054declare <2 x double> @__sind2_P8(<2 x double>) #055attributes #0 = { nounwind readnone speculatable willreturn }56attributes #1 = { "vector-function-abi-variant"="_ZGV_LLVM_N2v_llvm.sin.f64(__sind2_P8)" }57