2015-11-04 23:36:56 +00:00
|
|
|
; RUN: opt < %s -instcombine -S | FileCheck %s
|
|
|
|
|
2016-01-06 19:23:35 +00:00
|
|
|
define float @mytan(float %x) {
|
|
|
|
%call = call fast float @atanf(float %x)
|
|
|
|
%call1 = call fast float @tanf(float %call)
|
2015-11-04 23:36:56 +00:00
|
|
|
ret float %call1
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: define float @mytan(
|
|
|
|
; CHECK: ret float %x
|
|
|
|
|
2016-01-06 19:23:35 +00:00
|
|
|
define float @test2(float ()* %fptr) {
|
|
|
|
%call1 = call fast float %fptr()
|
|
|
|
%tan = call fast float @tanf(float %call1)
|
2015-11-26 09:51:17 +00:00
|
|
|
ret float %tan
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: @test2
|
|
|
|
; CHECK: tanf
|
|
|
|
|
2016-01-06 19:23:35 +00:00
|
|
|
declare float @tanf(float)
|
|
|
|
declare float @atanf(float)
|
|
|
|
|