130 lines · plain
1; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -O1 < %s | FileCheck %s2 3; double x, y;4; 5; void foo1()6; {7; x = y = 1.1;8; for (int i = 0; i < 175; i++)9; y = x + y; 10; }11; void foo2()12; {13; x = y = 1.1;14; for (int i = 0; i < 175; i++)15; y = x - y; 16; }17; void foo3()18; {19; x = y = 1.1;20; for (int i = 0; i < 175; i++)21; y = x * y; 22; }23; void foo4()24; {25; x = y = 1.1;26; for (int i = 0; i < 175; i++)27; y = x / y; 28; }29 30target datalayout = "E-m:e-p:32:32-i64:64-n32"31target triple = "powerpc-buildroot-linux-gnu"32 33@y = common global double 0.000000e+00, align 834@x = common global double 0.000000e+00, align 835 36define void @foo1() #0 {37 store double 1.100000e+00, ptr @y, align 838 store double 1.100000e+00, ptr @x, align 839 br label %240 41; <label>:1 ; preds = %242 %.lcssa = phi double [ %4, %2 ]43 store double %.lcssa, ptr @y, align 844 ret void45 46; <label>:2 ; preds = %2, %047 %3 = phi double [ 1.100000e+00, %0 ], [ %4, %2 ]48 %i.01 = phi i32 [ 0, %0 ], [ %5, %2 ]49 %4 = fadd double %3, 1.100000e+0050 %5 = add nuw nsw i32 %i.01, 151 %exitcond = icmp eq i32 %5, 7552 br i1 %exitcond, label %1, label %253 ; CHECK: bl __adddf354 ; CHECK: cmplwi55 ; CHECK-NOT: li {{[0-9]+}}, 17556 ; CHECK-NOT: mtctr {{[0-9]+}}57}58 59define void @foo2() #0 {60 store double 1.100000e+00, ptr @y, align 861 store double 1.100000e+00, ptr @x, align 862 br label %263 64; <label>:1 ; preds = %265 %.lcssa = phi double [ %4, %2 ]66 store double %.lcssa, ptr @y, align 867 ret void68 69; <label>:2 ; preds = %2, %070 %3 = phi double [ 1.100000e+00, %0 ], [ %4, %2 ]71 %i.01 = phi i32 [ 0, %0 ], [ %5, %2 ]72 %4 = fsub double 1.100000e+00, %373 %5 = add nuw nsw i32 %i.01, 174 %exitcond = icmp eq i32 %5, 7575 br i1 %exitcond, label %1, label %276 ; CHECK: bl __subdf377 ; CHECK: cmplwi78 ; CHECK-NOT: li {{[0-9]+}}, 17579 ; CHECK-NOT: mtctr {{[0-9]+}}80}81 82define void @foo3() #0 {83 store double 1.100000e+00, ptr @y, align 884 store double 1.100000e+00, ptr @x, align 885 br label %286 87; <label>:1 ; preds = %288 %.lcssa = phi double [ %4, %2 ]89 store double %.lcssa, ptr @y, align 890 ret void91 92; <label>:2 ; preds = %2, %093 %3 = phi double [ 1.100000e+00, %0 ], [ %4, %2 ]94 %i.01 = phi i32 [ 0, %0 ], [ %5, %2 ]95 %4 = fmul double %3, 1.100000e+0096 %5 = add nuw nsw i32 %i.01, 197 %exitcond = icmp eq i32 %5, 7598 br i1 %exitcond, label %1, label %299 ; CHECK: bl __muldf3100 ; CHECK: cmplwi101 ; CHECK-NOT: li {{[0-9]+}}, 175102 ; CHECK-NOT: mtctr {{[0-9]+}}103}104 105define void @foo4() #0 {106 store double 1.100000e+00, ptr @y, align 8107 store double 1.100000e+00, ptr @x, align 8108 br label %2109 110; <label>:1 ; preds = %2111 %.lcssa = phi double [ %4, %2 ]112 store double %.lcssa, ptr @y, align 8113 ret void114 115; <label>:2 ; preds = %2, %0116 %3 = phi double [ 1.100000e+00, %0 ], [ %4, %2 ]117 %i.01 = phi i32 [ 0, %0 ], [ %5, %2 ]118 %4 = fdiv double 1.100000e+00, %3119 %5 = add nuw nsw i32 %i.01, 1120 %exitcond = icmp eq i32 %5, 75121 br i1 %exitcond, label %1, label %2122 ; CHECK: bl __divdf3123 ; CHECK: cmplwi124 ; CHECK-NOT: li {{[0-9]+}}, 175125 ; CHECK-NOT: mtctr {{[0-9]+}}126}127 128attributes #0 = { "use-soft-float"="true" }129 130