summaryrefslogtreecommitdiff
path: root/ar-lib
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2020-10-08 17:12:18 -0300
committerAlexandre Oliva <oliva@gnu.org>2020-10-08 17:12:18 -0300
commita500588aa523f1f04ae51809e476e3ebfcb081d3 (patch)
tree15e5f671a4efdb0fe4f0dd74cd0a87b1c84b165b /ar-lib
parentd1c566d72d9361b37213881222c7e2713cdf05b7 (diff)
downloadgcc-a500588aa523f1f04ae51809e476e3ebfcb081d3.tar.gz
take type from intrinsic in sincos pass
This is a first step towards enabling the sincos optimization in Ada. The issue this patch solves is that sincos takes the type to be looked up with mathfn_built_in from variables or temporaries passed as arguments to SIN and COS intrinsics. In Ada, different float types may be used but, despite their representation equivalence, their distinctness causes the optimization to be skipped, because they are not the types that mathfn_built_in expects. This patch introduces a function that maps intrinsics to the type they're associated with, and uses that type, obtained from the intrinsics used in calls to be optimized, to look up the correspoding CEXPI intrinsic. For the sake of defensive programming, when using the type obtained from the intrinsic, it now checks that, if different types are found for the used argument, or for other calls that use it, that the types are interchangeable. for gcc/ChangeLog * builtins.c (mathfn_built_in_type): New. * builtins.h (mathfn_built_in_type): Declare. * tree-ssa-math-opts.c (execute_cse_sincos_1): Use it to obtain the type expected by the intrinsic.
Diffstat (limited to 'ar-lib')
0 files changed, 0 insertions, 0 deletions