1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -early-cse -earlycse-debug-hash -S -o - %s | FileCheck %s
3
4declare double @atan2(double, double) #0
5define double @f_atan2() {
6; CHECK-LABEL: @f_atan2(
7; CHECK-NEXT:    [[RES:%.*]] = tail call fast double @atan2(double 1.000000e+00, double 2.000000e+00)
8; CHECK-NEXT:    ret double 0x3FDDAC6{{.+}}
9;
10  %res = tail call fast double @atan2(double 1.0, double 2.0)
11  ret double %res
12}
13
14declare float @fmodf(float, float) #0
15define float @f_fmodf() {
16; CHECK-LABEL: @f_fmodf(
17; CHECK-NEXT:    ret float 1.000000e+00
18;
19  %res = tail call fast float @fmodf(float 1.0, float 2.0)
20  ret float %res
21}
22
23declare float @remainderf(float, float) #0
24define float @f_remainderf_fold1() {
25; CHECK-LABEL: @f_remainderf_fold1(
26; CHECK-NEXT:    ret float 1.000000e+00
27;
28  %res = tail call fast float @remainderf(float 1.0, float 2.0)
29  ret float %res
30}
31
32define float @f_remainderf_fold2() {
33; CHECK-LABEL: @f_remainderf_fold2(
34; CHECK-NEXT:    ret float -5.000000e-01
35;
36  %res = tail call fast float @remainderf(float 1.5, float 1.0)
37  ret float %res
38}
39
40define float @f_remainderf_nofold() {
41; CHECK-LABEL: @f_remainderf_nofold(
42; CHECK-NEXT:    [[RES:%.*]] = tail call fast float @remainderf(float 1.000000e+00, float 0.000000e+00)
43; CHECK-NEXT:    ret float [[RES]]
44;
45  %res = tail call fast float @remainderf(float 1.0, float 0.0)
46  ret float %res
47}
48
49declare double @remainder(double, double) #0
50define double @f_remainder_fold1() {
51; CHECK-LABEL: @f_remainder_fold1(
52; CHECK-NEXT:    ret double 1.000000e+00
53;
54  %res = tail call fast double @remainder(double 1.0, double 2.0)
55  ret double %res
56}
57
58define double @f_remainder_fold2() {
59; CHECK-LABEL: @f_remainder_fold2(
60; CHECK-NEXT:    ret double -5.000000e-01
61;
62  %res = tail call fast double @remainder(double 1.5, double 1.0)
63  ret double %res
64}
65
66define double @f_remainder_nofold() {
67; CHECK-LABEL: @f_remainder_nofold(
68; CHECK-NEXT:    [[RES:%.*]] = tail call fast double @remainder(double 1.000000e+00, double 0.000000e+00)
69; CHECK-NEXT:    ret double [[RES]]
70;
71  %res = tail call fast double @remainder(double 1.0, double 0.0)
72  ret double %res
73}
74
75declare double @pow(double, double) #0
76define double @f_pow() {
77; CHECK-LABEL: @f_pow(
78; CHECK-NEXT:    ret double 1.000000e+00
79;
80  %res = tail call fast double @pow(double 1.0, double 2.0)
81  ret double %res
82}
83
84declare float @llvm.pow.f32(float, float)
85define float @i_powf() {
86; CHECK-LABEL: @i_powf(
87; CHECK-NEXT:    ret float 1.000000e+00
88;
89  %res = tail call fast float @llvm.pow.f32(float 1.0, float 2.0)
90  ret float %res
91}
92
93declare double @llvm.powi.f64(double, i32)
94define double @i_powi() {
95; CHECK-LABEL: @i_powi(
96; CHECK-NEXT:    ret double 1.000000e+00
97;
98  %res = tail call fast double @llvm.powi.f64(double 1.0, i32 2)
99  ret double %res
100}
101
102attributes #0 = { nofree nounwind willreturn }
103