[patch, fortran] Remove bounds checking in DO loops for inline matmul
Thomas Koenig
tkoenig@netcologne.de
Sun Jun 10 15:13:00 GMT 2018
Hello world,
the attached patch was motivated by the desire to reduce the runtime
of programs with -fcheck=bounds with (some) optimization, in order
to make debugging less time consuming.
This patch removes the run-time bounds checks with -fcheck=bounds
in the DO loops created by matmul inlining. The Necessary checks are
already performed outside the loop, so the inner tests are not needed.
OK for trunk?
Regards
Thomas
2018-06-10 Thomas Koenig <tkoenig@gcc.gnu.org>
* gfortran.h (gfc_expr): Add no_bounds_check field.
* frontend-passes.c (get_array_inq_function): Set no_bounds_check
on function and function argument.
(inline_matmul_assign): Set no_bounds_check on zero expression
and on lhs of zero expression.
Also handle A1B2 case if realloc on assigment is active.
* trans-array.c (gfc_conv_array_ref): Don't do range checking
if expr has no_bounds_check set.
(gfc_conv_expr_descriptor): Set no_bounds_check on ss if expr
has it set.
* trans-expr.c (gfc_trans_assignment_1): Set no_bounds_check
on lss and lss if the corresponding expressions have it set.
2018-06-10 Thomas Koenig <tkoenig@gcc.gnu.org>
* gfortran.dg/inline_matmul_23.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline_matmul_23.f90
Type: text/x-fortran
Size: 358 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20180610/b6958794/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p1.diff
Type: text/x-patch
Size: 5350 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20180610/b6958794/attachment-0001.bin>
More information about the Fortran
mailing list