llvm/test/Transforms/InstCombine/pow-sqrt.ll
Davide Italiano 1ea5b393e5 [SimplifyLibCalls] Restore the old behaviour, emit a libcall.
Hal pointed out that the semantic of our intrinsic and the libc
call are slightly different. Add a comment while I'm here to
explain why we can't emit an intrinsic. Thanks Hal!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 06:33:32 +00:00

14 lines
354 B
LLVM

; RUN: opt < %s -instcombine -S | FileCheck %s
define double @pow_half(double %x) {
%pow = call fast double @llvm.pow.f64(double %x, double 5.000000e-01)
ret double %pow
}
; CHECK-LABEL: define double @pow_half(
; CHECK-NEXT: %sqrt = call fast double @sqrt(double %x)
; CHECK-NEXT: ret double %sqrt
declare double @llvm.pow.f64(double, double)