1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 21:42:54 +02:00
llvm-mirror/test/Transforms/InstCombine/pr26993.ll
David Majnemer ab6aef2bdd [SimplifyLibCalls] Only consider sinpi/cospi functions within the same function
The sinpi/cospi can be replaced with sincospi to remove unnecessary
computations.  However, we need to make sure that the calls are within
the same function!

This fixes PR26993.

llvm-svn: 263875
2016-03-19 04:53:02 +00:00

25 lines
613 B
LLVM

; RUN: opt -instcombine -S < %s | FileCheck %s
define double @test1() {
%sin = call double @__sinpi(double 1.0)
ret double %sin
}
; CHECK-LABEL: define double @test1(
; CHECK: %[[sin:.*]] = call double @__sinpi(double 1.000000e+00)
; CHECK-NEXT: ret double %[[sin]]
define double @test2() {
%cos = call double @__cospi(double 1.0)
ret double %cos
}
; CHECK-LABEL: define double @test2(
; CHECK: %[[cos:.*]] = call double @__cospi(double 1.000000e+00)
; CHECK-NEXT: ret double %[[cos]]
declare double @__sinpi(double %x) #0
declare double @__cospi(double %x) #0
attributes #0 = { readnone nounwind }