Ping: [Fortran] Inverted masks in WHERE statements
Paul Thomas
paulthomas2@wanadoo.fr
Wed Mar 1 22:39:00 GMT 2006
Roger,
>Could someone take a look at my latest WHERE optimization patch?
>http://gcc.gnu.org/ml/gcc-patches/2006-02/msg01735.html
>It's been a week without comment, which I suspect means that
>its managed to slipped through the cracks.
>
>
2006-02-20 Roger Sayle <roger@eyesopen.com>
* trans-stmt.c (generate_loop_for_temp_to_lhs): Add an additional
INVERT argument to invert the sense of the WHEREMASK argument.
Remove unneeded code to AND together a list of masks.
(generate_loop_for_rhs_to_temp): Likewise.
(gfc_trans_assign_need_temp): Likewise.
(gfc_trans_forall_1): Likewise.
(gfc_evaluate_where_mask): Likewise, add a new INVERT argument
to specify the sense of the MASK argument.
(gfc_trans_where_assign): Likewise.
(gfc_trans_where_2): Likewise. Restructure code that decides
whether we need to allocate zero, one or two temporary masks.
If this is a top-level WHERE (i.e. the incoming MAKS is NULL),
we only need to allocate at most one temporary mask, and can
invert it's sense to provide the complementary pending execution
mask. Only calculate the size of the required temporary arrays
if we need any.
(gfc_trans_where): Update call to gfc_trans_where_2.
OK. In fact, it's more than OK; it looks very nice indeed.
I had wondered why the extra mask was not eliminated!
Many thanks - I hope that you will keep on contributing.
Best regards
Paul
More information about the Fortran
mailing list