[SimplifyLibCalls] New trick: pow(x, 0.5) -> sqrt(x) under -ffast-math.
[oota-llvm.git] / test / Transforms / InstCombine / pow-sqrt.ll
1 ; RUN: opt < %s -instcombine -S | FileCheck %s
2
3 define double @mypow(double %x) #0 {
4 entry:
5   %pow = call double @llvm.pow.f64(double %x, double 5.000000e-01)
6   ret double %pow
7 }
8
9 ; CHECK-LABEL: define double @mypow(
10 ; CHECK:   %sqrt = call double @sqrt(double %x) #1
11 ; CHECK:   ret double %sqrt
12 ; CHECK: }
13
14 declare double @llvm.pow.f64(double, double)
15 attributes #0 = { "unsafe-fp-math"="true" }