1 ; RUN: opt -simplify-libcalls-halfpowr %s -S | FileCheck %s
3 define float @__half_powrf4(float %f, float %g) nounwind readnone {
5 %0 = fcmp olt float %f, 2.000000e+00 ; <i1> [#uses=1]
6 br i1 %0, label %bb, label %bb1
9 %1 = fdiv float %f, 3.000000e+00 ; <float> [#uses=1]
12 bb1: ; preds = %bb, %entry
13 %f_addr.0 = phi float [ %1, %bb ], [ %f, %entry ] ; <float> [#uses=1]
14 %2 = fmul float %f_addr.0, %g ; <float> [#uses=1]
15 ; CHECK: fmul float %f_addr
16 ; CHECK: fmul float %f_addr
17 ; CHECK: fmul float %f_addr
18 ; CHECK: fmul float %f_addr
23 define void @foo(float* %p) nounwind {
25 %0 = load float* %p, align 4 ; <float> [#uses=1]
26 %1 = getelementptr float* %p, i32 1 ; <float*> [#uses=1]
27 %2 = load float* %1, align 4 ; <float> [#uses=1]
28 %3 = getelementptr float* %p, i32 2 ; <float*> [#uses=1]
29 %4 = load float* %3, align 4 ; <float> [#uses=1]
30 %5 = getelementptr float* %p, i32 3 ; <float*> [#uses=1]
31 %6 = load float* %5, align 4 ; <float> [#uses=1]
32 %7 = getelementptr float* %p, i32 4 ; <float*> [#uses=1]
33 %8 = load float* %7, align 4 ; <float> [#uses=1]
34 %9 = getelementptr float* %p, i32 5 ; <float*> [#uses=1]
35 %10 = load float* %9, align 4 ; <float> [#uses=1]
36 %11 = tail call float @__half_powrf4(float %0, float %6) nounwind ; <float> [#uses=1]
37 %12 = tail call float @__half_powrf4(float %2, float %8) nounwind ; <float> [#uses=1]
38 %13 = tail call float @__half_powrf4(float %4, float %10) nounwind ; <float> [#uses=1]
39 %14 = getelementptr float* %p, i32 6 ; <float*> [#uses=1]
40 store float %11, float* %14, align 4
41 %15 = getelementptr float* %p, i32 7 ; <float*> [#uses=1]
42 store float %12, float* %15, align 4
43 %16 = getelementptr float* %p, i32 8 ; <float*> [#uses=1]
44 store float %13, float* %16, align 4