mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 23:18:51 +00:00
649040b838
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263875 91177308-0d34-0410-b5e6-96231b3b80d8
25 lines
613 B
LLVM
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 }
|