public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Cc: gcc Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [gimple-isel] Remove redundant if condition
Date: Tue, 5 Oct 2021 13:32:00 +0200	[thread overview]
Message-ID: <CAFiYyc2cBEXBziKyuG1orpCf_UpLCAT1ukOSaEzqFANCgJQfbQ@mail.gmail.com> (raw)
In-Reply-To: <CAAgBjMm+eyuWWbnYuE5ezSJOKj=x240Octf1HgG=MDUB-1p1+g@mail.gmail.com>

On Tue, Oct 5, 2021 at 9:11 AM Prathamesh Kulkarni via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hi,
> In gimple_expand_vec_cond_expr:
>
>   icode = get_vcond_icode (mode, cmp_op_mode, unsignedp);
>   if (icode == CODE_FOR_nothing)
>     {
>       if (tcode == LT_EXPR
>           && op0a == op0)
>         {
>           /* A VEC_COND_EXPR condition could be folded from EQ_EXPR/NE_EXPR
>              into a constant when only get_vcond_eq_icode is supported.
>              Try changing it to NE_EXPR.  */
>           tcode = NE_EXPR;
>         }
>       if ((tcode == EQ_EXPR || tcode == NE_EXPR)
>           && direct_internal_fn_supported_p (IFN_VCONDEQ, TREE_TYPE (lhs),
>                                              TREE_TYPE (op0a),
>                                              OPTIMIZE_FOR_BOTH))
>         {
>           tree tcode_tree = build_int_cst (integer_type_node, tcode);
>           return gimple_build_call_internal (IFN_VCONDEQ, 5, op0a, op0b, op1,
>                                              op2, tcode_tree);
>         }
>     }
>
>   if (icode == CODE_FOR_nothing)
>     {
>       gcc_assert (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (op0))
>                   && can_compute_op0
>                   && (get_vcond_mask_icode (mode, TYPE_MODE (TREE_TYPE (op0)))
>                       != CODE_FOR_nothing));
>       return gimple_build_call_internal (IFN_VCOND_MASK, 3, op0, op1, op2);
>     }
>
> It seems the second check for icode == COND_FOR_nothing is redundant,
> since icode is not reassigned in the previous block ?
> The attached patch removes the second if condition.
> OK to commit after bootstrap+test ?
>
OK.

> Thanks,
> Prathamesh

      reply	other threads:[~2021-10-05 11:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05  7:10 Prathamesh Kulkarni
2021-10-05 11:32 ` Richard Biener [this message]

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=CAFiYyc2cBEXBziKyuG1orpCf_UpLCAT1ukOSaEzqFANCgJQfbQ@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=prathamesh.kulkarni@linaro.org \
    /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).