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