xref: /aosp_15_r20/external/llvm/test/Transforms/InstCombine/tan.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -instcombine -S | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workerdefine float @mytan(float %x) {
4*9880d681SAndroid Build Coastguard Worker  %call = call fast float @atanf(float %x)
5*9880d681SAndroid Build Coastguard Worker  %call1 = call fast float @tanf(float %call)
6*9880d681SAndroid Build Coastguard Worker  ret float %call1
7*9880d681SAndroid Build Coastguard Worker}
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: define float @mytan(
10*9880d681SAndroid Build Coastguard Worker; CHECK:   ret float %x
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Workerdefine float @test2(float ()* %fptr) {
13*9880d681SAndroid Build Coastguard Worker  %call1 = call fast float %fptr()
14*9880d681SAndroid Build Coastguard Worker  %tan = call fast float @tanf(float %call1)
15*9880d681SAndroid Build Coastguard Worker  ret float %tan
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @test2
19*9880d681SAndroid Build Coastguard Worker; CHECK: tanf
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Workerdeclare float @tanf(float)
22*9880d681SAndroid Build Coastguard Workerdeclare float @atanf(float)
23*9880d681SAndroid Build Coastguard Worker
24