1 ; RUN: llc -mcpu=ppc64 < %s | FileCheck %s 2 target datalayout = "E-m:e-i64:64-n32:64" 3 target triple = "powerpc64-unknown-linux-gnu" 4 5 ; Following test case checks: 6 ; a / D; b / D; c / D; 7 ; => 8 ; recip = 1.0 / D; a * recip; b * recip; c * recip; 9 10 define void @three_fdiv_double(double %D, double %a, double %b, double %c) #0 { 11 ; CHECK-LABEL: three_fdiv_double: 12 ; CHECK: fdiv 13 ; CHECK-NEXT-NOT: fdiv 14 ; CHECK: fmul 15 ; CHECK: fmul 16 ; CHECK: fmul 17 %div = fdiv double %a, %D 18 %div1 = fdiv double %b, %D 19 %div2 = fdiv double %c, %D 20 tail call void @foo_3d(double %div, double %div1, double %div2) 21 ret void 22 } 23 24 define void @two_fdiv_double(double %D, double %a, double %b) #0 { 25 ; CHECK-LABEL: two_fdiv_double: 26 ; CHECK: fdiv 27 ; CHECK: fdiv 28 ; CHECK-NEXT-NOT: fmul 29 %div = fdiv double %a, %D 30 %div1 = fdiv double %b, %D 31 tail call void @foo_2d(double %div, double %div1) 32 ret void 33 } 34 35 declare void @foo_3d(double, double, double) 36 declare void @foo_3_2xd(<2 x double>, <2 x double>, <2 x double>) 37 declare void @foo_2d(double, double) 38 39 attributes #0 = { "unsafe-fp-math"="true" } 40