| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 | |
| ; RUN: opt < %s -passes=instcombine -mtriple x86_64-unknown-linux-gnu -S | FileCheck %s | |
| define float @erff_const() { | |
| ; CHECK-LABEL: define float @erff_const() { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float 5.000000e-01) | |
| ; CHECK-NEXT: ret float f0x3F053F7B | |
| ; | |
| %r = call float @erff(float 5.000000e-01) | |
| ret float %r | |
| } | |
| define double @erf_const() { | |
| ; CHECK-LABEL: define double @erf_const() { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double -5.000000e-01) | |
| ; CHECK-NEXT: ret double f0xBFE0A7EF5C18EDD2 | |
| ; | |
| %r = call double @erf(double -5.000000e-01) | |
| ret double %r | |
| } | |
| define float @erff_zero() { | |
| ; CHECK-LABEL: define float @erff_zero() { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float 0.000000e+00) | |
| ; CHECK-NEXT: ret float 0.000000e+00 | |
| ; | |
| %r = call float @erff(float 0.000000e+00) | |
| ret float %r | |
| } | |
| define double @erf_zero() { | |
| ; CHECK-LABEL: define double @erf_zero() { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double 0.000000e+00) | |
| ; CHECK-NEXT: ret double 0.000000e+00 | |
| ; | |
| %r = call double @erf(double 0.000000e+00) | |
| ret double %r | |
| } | |
| define float @erff_neg_zero() { | |
| ; CHECK-LABEL: define float @erff_neg_zero() { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float -0.000000e+00) | |
| ; CHECK-NEXT: ret float -0.000000e+00 | |
| ; | |
| %r = call float @erff(float -0.000000e+00) | |
| ret float %r | |
| } | |
| define double @erf_neg_zero() { | |
| ; CHECK-LABEL: define double @erf_neg_zero() { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double -0.000000e+00) | |
| ; CHECK-NEXT: ret double -0.000000e+00 | |
| ; | |
| %r = call double @erf(double -0.000000e+00) | |
| ret double %r | |
| } | |
| define float @erff_inf() { | |
| ; CHECK-LABEL: define float @erff_inf() { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float +inf) | |
| ; CHECK-NEXT: ret float [[R]] | |
| ; | |
| %r = call float @erff(float +inf) | |
| ret float %r | |
| } | |
| define double @erf_inf() { | |
| ; CHECK-LABEL: define double @erf_inf() { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double +inf) | |
| ; CHECK-NEXT: ret double [[R]] | |
| ; | |
| %r = call double @erf(double +inf) | |
| ret double %r | |
| } | |
| define float @erff_inf_memory_none() { | |
| ; CHECK-LABEL: define float @erff_inf_memory_none() { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float +inf) #[[ATTR2:[0-9]+]] | |
| ; CHECK-NEXT: ret float [[R]] | |
| ; | |
| %r = call float @erff(float +inf) readnone | |
| ret float %r | |
| } | |
| define double @erf_inf_memory_none() { | |
| ; CHECK-LABEL: define double @erf_inf_memory_none() { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double +inf) #[[ATTR2]] | |
| ; CHECK-NEXT: ret double [[R]] | |
| ; | |
| %r = call double @erf(double +inf) readnone | |
| ret double %r | |
| } | |
| define float @erff_neg_inf() { | |
| ; CHECK-LABEL: define float @erff_neg_inf() { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float -inf) | |
| ; CHECK-NEXT: ret float [[R]] | |
| ; | |
| %r = call float @erff(float -inf) | |
| ret float %r | |
| } | |
| define double @erf_neg_inf() { | |
| ; CHECK-LABEL: define double @erf_neg_inf() { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double -inf) | |
| ; CHECK-NEXT: ret double [[R]] | |
| ; | |
| %r = call double @erf(double -inf) | |
| ret double %r | |
| } | |
| define float @erff_neg_inf_memory_none() { | |
| ; CHECK-LABEL: define float @erff_neg_inf_memory_none() { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float -inf) #[[ATTR2]] | |
| ; CHECK-NEXT: ret float [[R]] | |
| ; | |
| %r = call float @erff(float -inf) readnone | |
| ret float %r | |
| } | |
| define double @erf_neg_inf_memory_none() { | |
| ; CHECK-LABEL: define double @erf_neg_inf_memory_none() { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double -inf) #[[ATTR2]] | |
| ; CHECK-NEXT: ret double [[R]] | |
| ; | |
| %r = call double @erf(double -inf) readnone | |
| ret double %r | |
| } | |
| define float @erff_nan() { | |
| ; CHECK-LABEL: define float @erff_nan() { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float +qnan) | |
| ; CHECK-NEXT: ret float [[R]] | |
| ; | |
| %r = call float @erff(float +qnan) | |
| ret float %r | |
| } | |
| define double @erf_nan() { | |
| ; CHECK-LABEL: define double @erf_nan() { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double +qnan) | |
| ; CHECK-NEXT: ret double [[R]] | |
| ; | |
| %r = call double @erf(double +qnan) | |
| ret double %r | |
| } | |
| define float @erff_nan_memory_none() { | |
| ; CHECK-LABEL: define float @erff_nan_memory_none() { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float +qnan) #[[ATTR2]] | |
| ; CHECK-NEXT: ret float [[R]] | |
| ; | |
| %r = call float @erff(float +qnan) readnone | |
| ret float %r | |
| } | |
| define double @erf_nan_memory_none() { | |
| ; CHECK-LABEL: define double @erf_nan_memory_none() { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double +qnan) #[[ATTR2]] | |
| ; CHECK-NEXT: ret double [[R]] | |
| ; | |
| %r = call double @erf(double +qnan) readnone | |
| ret double %r | |
| } | |
| define float @erff_poison() { | |
| ; CHECK-LABEL: define float @erff_poison() { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float poison) | |
| ; CHECK-NEXT: ret float [[R]] | |
| ; | |
| %r = call float @erff(float poison) | |
| ret float %r | |
| } | |
| define double @erf_poison() { | |
| ; CHECK-LABEL: define double @erf_poison() { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double poison) | |
| ; CHECK-NEXT: ret double [[R]] | |
| ; | |
| %r = call double @erf(double poison) | |
| ret double %r | |
| } | |
| define float @erff_const_strictfp() strictfp { | |
| ; CHECK-LABEL: define float @erff_const_strictfp( | |
| ; CHECK-SAME: ) #[[ATTR0:[0-9]+]] { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float 5.000000e-01) #[[ATTR0]] | |
| ; CHECK-NEXT: ret float [[R]] | |
| ; | |
| %r = call float @erff(float 5.000000e-01) strictfp | |
| ret float %r | |
| } | |
| define double @erf_const_strictfp() strictfp { | |
| ; CHECK-LABEL: define double @erf_const_strictfp( | |
| ; CHECK-SAME: ) #[[ATTR0]] { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double -5.000000e-01) #[[ATTR0]] | |
| ; CHECK-NEXT: ret double [[R]] | |
| ; | |
| %r = call double @erf(double -5.000000e-01) strictfp | |
| ret double %r | |
| } | |
| define float @erff_nan_strictfp() strictfp { | |
| ; CHECK-LABEL: define float @erff_nan_strictfp( | |
| ; CHECK-SAME: ) #[[ATTR0]] { | |
| ; CHECK-NEXT: [[R:%.*]] = call float @erff(float +qnan) #[[ATTR0]] | |
| ; CHECK-NEXT: ret float [[R]] | |
| ; | |
| %r = call float @erff(float +qnan) strictfp | |
| ret float %r | |
| } | |
| define double @erf_nan_strictfp() strictfp { | |
| ; CHECK-LABEL: define double @erf_nan_strictfp( | |
| ; CHECK-SAME: ) #[[ATTR0]] { | |
| ; CHECK-NEXT: [[R:%.*]] = call double @erf(double +qnan) #[[ATTR0]] | |
| ; CHECK-NEXT: ret double [[R]] | |
| ; | |
| %r = call double @erf(double +qnan) strictfp | |
| ret double %r | |
| } | |
| declare float @erff(float) willreturn | |
| declare double @erf(double) willreturn |