diff options
author | Victor Do Nascimento <victor.donascimento@arm.com> | 2024-08-07 13:37:47 +0100 |
---|---|---|
committer | Victor Do Nascimento <victor.donascimento@arm.com> | 2024-10-07 13:07:01 +0100 |
commit | fef86de89576db4aee1ad248a7886545ef6967d7 (patch) | |
tree | 03346593a6818465585652f946baea5cc15f2d33 /gcc/gcov.cc | |
parent | 03299164830e19405b35a5fa862e248df4ea01e2 (diff) | |
download | gcc-fef86de89576db4aee1ad248a7886545ef6967d7.zip gcc-fef86de89576db4aee1ad248a7886545ef6967d7.tar.gz gcc-fef86de89576db4aee1ad248a7886545ef6967d7.tar.bz2 |
middle-end: reorder masking priority of math functions
Given the categorization of math built-in functions as `ECF_CONST',
when if-converting their uses, their calls are not masked and are thus
called with an all-true predicate.
This, however, is not appropriate where built-ins have library
equivalents, wherein they may exhibit highly architecture-specific
behaviors. For example, vectorized implementations may delegate the
computation of values outside a certain acceptable numerical range to
special (non-vectorized) routines which considerably slow down
computation.
As numerical simulation programs often do bounds check on input values
prior to math calls, conditionally assigning default output values for
out-of-bounds input and skipping the math call altogether, these
fallback implementations should seldom be called in the execution of
vectorized code. If, however, we don't apply any masking to these
math functions, we end up effectively executing both if and else
branches for these values, leading to considerable performance
degradation on scientific workloads.
We therefore invert the order of handling of math function calls in
`if_convertible_stmt_p' to prioritize the handling of their
library-provided implementations over the equivalent internal function.
gcc/ChangeLog:
* tree-if-conv.cc (if_convertible_stmt_p): Check for explicit
function declaration before IFN fallback.
gcc/testsuite/ChangeLog:
* gcc.dg/vect/vect-fncall-mask-math.c: New.
Diffstat (limited to 'gcc/gcov.cc')
0 files changed, 0 insertions, 0 deletions