1; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse2 | FileCheck %s 2; Ideally this would compile to 5 multiplies. 3 4define double @pow_wrapper(double %a) nounwind readonly ssp noredzone { 5; CHECK-LABEL: pow_wrapper: 6; CHECK: # BB#0: 7; CHECK-NEXT: movapd %xmm0, %xmm1 8; CHECK-NEXT: mulsd %xmm1, %xmm1 9; CHECK-NEXT: mulsd %xmm1, %xmm0 10; CHECK-NEXT: mulsd %xmm1, %xmm1 11; CHECK-NEXT: mulsd %xmm1, %xmm0 12; CHECK-NEXT: mulsd %xmm1, %xmm1 13; CHECK-NEXT: mulsd %xmm0, %xmm1 14; CHECK-NEXT: movapd %xmm1, %xmm0 15; CHECK-NEXT: retq 16 %ret = tail call double @llvm.powi.f64(double %a, i32 15) nounwind ; <double> [#uses=1] 17 ret double %ret 18} 19 20define double @pow_wrapper_optsize(double %a) optsize { 21; CHECK-LABEL: pow_wrapper_optsize: 22; CHECK: # BB#0: 23; CHECK-NEXT: movl $15, %edi 24; CHECK-NEXT: jmp 25 %ret = tail call double @llvm.powi.f64(double %a, i32 15) nounwind ; <double> [#uses=1] 26 ret double %ret 27} 28 29define double @pow_wrapper_minsize(double %a) minsize { 30; CHECK-LABEL: pow_wrapper_minsize: 31; CHECK: # BB#0: 32; CHECK-NEXT: pushq $15 33; CHECK: popq %rdi 34; CHECK: jmp 35 %ret = tail call double @llvm.powi.f64(double %a, i32 15) nounwind ; <double> [#uses=1] 36 ret double %ret 37} 38 39declare double @llvm.powi.f64(double, i32) nounwind readonly 40 41