mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
2063637fa7
* pow(x, 0.5) -> fabs(sqrt(x)) * pow(2.0, x) -> exp2(x) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188656 91177308-0d34-0410-b5e6-96231b3b80d8
13 lines
472 B
LLVM
13 lines
472 B
LLVM
; Test that the pow won't get simplified to sqrt(fabs) when they are not available.
|
|
;
|
|
; RUN: opt < %s -disable-simplify-libcalls -instcombine -S | FileCheck %s
|
|
|
|
declare double @llvm.pow.f64(double %Val, double %Power)
|
|
|
|
define double @test_simplify_unavailable(double %x) {
|
|
; CHECK-LABEL: @test_simplify_unavailable(
|
|
%retval = call double @llvm.pow.f64(double %x, double 0.5)
|
|
; CHECK-NEXT: call double @llvm.pow.f64(double %x, double 5.000000e-01)
|
|
ret double %retval
|
|
}
|