1; RUN: llc < %s -mtriple=armv6-apple-darwin9 -mattr=+vfp2 2; rdar://6653182 3 4 5%struct.ggBRDF = type { ptr } 6%struct.ggPoint2 = type { [2 x double] } 7%struct.ggPoint3 = type { [3 x double] } 8%struct.ggSpectrum = type { [8 x float] } 9%struct.ggSphere = type { %struct.ggPoint3, double } 10%struct.mrDiffuseAreaSphereLuminaire = type { %struct.mrSphere, %struct.ggSpectrum } 11%struct.mrDiffuseCosineSphereLuminaire = type { %struct.mrDiffuseAreaSphereLuminaire } 12%struct.mrSphere = type { %struct.ggBRDF, %struct.ggSphere } 13 14declare double @llvm.sqrt.f64(double) nounwind readonly 15 16declare double @sin(double) nounwind readonly 17 18declare double @acos(double) nounwind readonly 19 20define i32 @_ZNK34mrDiffuseSolidAngleSphereLuminaire18selectVisiblePointERK8ggPoint3RK9ggVector3RK8ggPoint2dRS0_Rd(ptr nocapture %this, ptr nocapture %x, ptr nocapture %unnamed_arg, ptr nocapture %uv, double %unnamed_arg2, ptr nocapture %on_light, ptr nocapture %invProb) nounwind { 21entry: 22 %0 = call double @llvm.sqrt.f64(double 0.000000e+00) nounwind 23 %1 = fcmp ult double 0.000000e+00, %0 24 br i1 %1, label %bb3, label %bb7 25 26bb3: ; preds = %entry 27 %2 = fdiv double 1.000000e+00, 0.000000e+00 28 %3 = fmul double 0.000000e+00, %2 29 %4 = call double @llvm.sqrt.f64(double 0.000000e+00) nounwind 30 %5 = fdiv double 1.000000e+00, %4 31 %6 = fmul double %3, %5 32 %7 = fmul double 0.000000e+00, %5 33 %8 = fmul double %3, %7 34 %9 = fsub double %8, 0.000000e+00 35 %10 = fmul double 0.000000e+00, %6 36 %11 = fsub double 0.000000e+00, %10 37 %12 = fsub double -0.000000e+00, %11 38 %13 = fmul double %0, %0 39 %14 = fsub double %13, 0.000000e+00 40 %15 = call double @llvm.sqrt.f64(double %14) 41 %16 = fmul double 0.000000e+00, %15 42 %17 = fdiv double %16, %0 43 %18 = fadd double 0.000000e+00, %17 44 %19 = call double @acos(double %18) nounwind readonly 45 %20 = load double, ptr null, align 4 46 %21 = fmul double %20, 0x401921FB54442D18 47 %22 = call double @sin(double %19) nounwind readonly 48 %23 = fmul double %22, 0.000000e+00 49 %24 = fmul double %6, %23 50 %25 = fmul double %7, %23 51 %26 = call double @sin(double %21) nounwind readonly 52 %27 = fmul double %22, %26 53 %28 = fmul double %9, %27 54 %29 = fmul double %27, %12 55 %30 = fadd double %24, %28 56 %31 = fadd double 0.000000e+00, %29 57 %32 = fadd double %25, 0.000000e+00 58 %33 = fadd double %30, 0.000000e+00 59 %34 = fadd double %31, 0.000000e+00 60 %35 = fadd double %32, 0.000000e+00 61 call void @llvm.memcpy.p0.p0.i32(ptr align 4 null, ptr align 4 %x, i32 24, i1 false) 62 store double %33, ptr null, align 8 63 br i1 false, label %_Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit, label %bb5.i.i.i 64 65bb5.i.i.i: ; preds = %bb3 66 unreachable 67 68_Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit: ; preds = %bb3 69 %36 = fsub double %13, 0.000000e+00 70 %37 = fsub double -0.000000e+00, %34 71 %38 = fsub double -0.000000e+00, %35 72 ret i32 1 73 74bb7: ; preds = %entry 75 ret i32 0 76} 77 78declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1) nounwind 79