public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alan Lawrence <alan.lawrence@arm.com>
To: Abe <abe_skolnik@yahoo.com>
Cc: Sebastian Pop <sebpop@gmail.com>,
	 Richard Biener <richard.guenther@gmail.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] fix PR46029: reimplement if conversion of loads and stores [2nd submitted version of patch]
Date: Thu, 02 Jul 2015 09:49:00 -0000	[thread overview]
Message-ID: <55950935.1060008@arm.com> (raw)
In-Reply-To: <5593142A.7020607@yahoo.com>

Thanks, Abe. A couple comments below...

> @@ -883,7 +733,7 @@ if_convertible_gimple_assign_stmt_p (gimple stmt,
> 
>     if (flag_tree_loop_if_convert_stores)
>       {
> -      if (ifcvt_could_trap_p (stmt, refs))
> +      if (ifcvt_could_trap_p (stmt))
>         {
>           if (ifcvt_can_use_mask_load_store (stmt))
>             {
> @@ -892,9 +742,17 @@ if_convertible_gimple_assign_stmt_p (gimple stmt,
>               return true;
>             }
>           if (dump_file && (dump_flags & TDF_DETAILS))
> -           fprintf (dump_file, "tree could trap...\n");
> +           fprintf (dump_file, "tree could trap\n");
>           return false;
>         }
> +
> +      if (has_non_addressable_refs (stmt))
> +       {
> +         if (dump_file && (dump_flags & TDF_DETAILS))
> +           fprintf (dump_file, "has non-addressable memory references\n");
> +         return false;
> +       }
> +
>         return true;
>       }

As before, I'm still confused here. This still returns false, i.e. bails out of
if-conversion, if the statement could trap. Doesn't the scratchpad let us handle
that? Or do we just not care because it won't be vectorizable anyway???

> @@ -1342,7 +1190,7 @@ if_convertible_loop_p_1 (struct loop *loop,
>         /* Check the if-convertibility of statements in predicated BBs.  */
>         if (!dominated_by_p (CDI_DOMINATORS, loop->latch, bb))
>         for (itr = gsi_start_bb (bb); !gsi_end_p (itr); gsi_next (&itr))
> -         if (!if_convertible_stmt_p (gsi_stmt (itr), *refs,
> +         if (!if_convertible_stmt_p (gsi_stmt (itr),
>                                       any_mask_load_store))

Nit: as before - line no longer needs wrapping (a few other cases too)

> @@ -2063,12 +1997,14 @@ mask_exists (int size, vec<int> vec)
>      | end_bb_1
>      |
>      | bb_2
> +   |   cond = some_computation;

Nit: as before - thanks for fixing the example here, but...

>      |   if (cond) goto bb_3 else goto bb_4
>      | end_bb_2
>      |
>      | bb_3
>      |   cond = some_computation;

...I think you mean to remove this last too.

> @@ -2817,10 +2761,26 @@ public:
>   bool
>   pass_if_conversion::gate (function *fun)
>   {
> -  return (((flag_tree_loop_vectorize || fun->has_force_vectorize_loops)
> -          && flag_tree_loop_if_convert != 0)
> -         || flag_tree_loop_if_convert == 1
> -         || flag_tree_loop_if_convert_stores == 1);
> +  return  (
> +            (
> +              flag_tree_loop_vectorize
> +           || fun->has_force_vectorize_loops
> +            )
> +         && (
> +              (
> +                flag_tree_loop_if_convert        != 0
> +              )
> +           || (
> +                flag_tree_loop_if_convert_stores != 0
> +              )
> +            )
> +         )
> +         || (
> +              flag_tree_loop_if_convert        > 0
> +            )
> +         || (
> +              flag_tree_loop_if_convert_stores > 0
> +            );
>   }

That is quite complex. Where can I find info on what the different flag values 
mean? (I had thought they were booleans, clearly I'm wrong, but a quick scan 
through invoke.texi doesn't seem to help; both your testcases and your updates 
to invoke.texi say e.g. -ftree-loop-if-convert-stores not 
-ftree-loop-if-convert-stores=<value>)


Cheers, Alan

  reply	other threads:[~2015-07-02  9:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 22:18 Abe
2015-07-02  9:49 ` Alan Lawrence [this message]
2015-07-02 20:18   ` Abe
2015-07-06 15:09     ` Alan Lawrence
2015-07-06 17:46       ` Abe
2015-07-08 15:30       ` Abe
2015-07-08 16:54         ` Alan Lawrence
2015-07-08 18:12           ` Abe
2015-07-09 15:57             ` [PATCH] fix PR46029: reimplement if conversion of loads and stores [3nd " Abe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55950935.1060008@arm.com \
    --to=alan.lawrence@arm.com \
    --cc=abe_skolnik@yahoo.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    --cc=sebpop@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).