public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: kugan <kugan.vivekanandarajah@linaro.org>,
	       "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PR66726] Fix regression caused by Factor conversion out of COND_EXPR
Date: Wed, 22 Jun 2016 03:16:00 -0000	[thread overview]
Message-ID: <f149502d-530e-729e-d782-c53b80879c35@redhat.com> (raw)
In-Reply-To: <574EBCEC.70805@linaro.org>

On 06/01/2016 04:46 AM, kugan wrote:
>
> Hi All,
>
> Factoring out CONVERT_EXPR introduced a regression for (PR66726). I had
> to revert my previous patch due to some regressions. This is a much
> simplified version compared to the one I reverted.
>
> There is a test-case (pr46309.c) in the test-suite which is valid for
> targets that has branch cost greater than 1.
>
> This patch makes optimize_range_tests understand the factored out
> COND_EXPR. i.e., Updated the final_range_test_p to look for the new
> pattern. Changed the maybe_optimize_range_tests (which does the inter
> basic block range test optimization) accordingly.
>
> With the patch
> m68k-linux-gnu-gcc -O2 -S pr46309.c -fdump-tree-reassoc-details
> grep -e "Optimizing range tests" -e into
> pr46309.c.*.reassoc1pr46309.c.114t.reassoc1:Optimizing range tests
> a_6(D) -[1, 1] and -[2, 2] and -[3, 3] and -[4, 4]
> pr46309.c.114t.reassoc1: into (unsigned int) a_6(D) + 4294967295 > 3
> pr46309.c.114t.reassoc1: into _10 = _13;
> pr46309.c.114t.reassoc1:Optimizing range tests a_6(D) -[1, 1] and -[2,
> 2] and -[3, 3] and -[4, 4]
> pr46309.c.114t.reassoc1: into (unsigned int) a_6(D) + 4294967295 > 3
> pr46309.c.114t.reassoc1: into _10 = _13;
> pr46309.c.114t.reassoc1:Optimizing range tests a_4(D) -[1, 1] and -[3, 3]
> pr46309.c.114t.reassoc1: into (a_4(D) & -3) != 1
> pr46309.c.114t.reassoc1: into _6 = _8;
> pr46309.c.114t.reassoc1:Optimizing range tests a_4(D) -[1, 1] and -[2, 2]
> pr46309.c.114t.reassoc1: into (unsigned int) a_4(D) + 4294967295 > 1
> pr46309.c.114t.reassoc1: into _6 = _9;
> pr46309.c.114t.reassoc1:Optimizing range tests a_5(D) -[0, 31] and -[64,
> 95]
> pr46309.c.114t.reassoc1: into (a_5(D) & 4294967231) > 31
> pr46309.c.114t.reassoc1: into _7 = _9;
> pr46309.c.114t.reassoc1:Optimizing range tests a_9(D) -[0, 31] and -[64,
> 95]
> pr46309.c.114t.reassoc1: into (a_9(D) & 4294967231) > 31
> pr46309.c.114t.reassoc1:Optimizing range tests a_9(D) -[128, 159] and
> -[192, 223]
> pr46309.c.114t.reassoc1: into (a_9(D) & 4294967231) + 4294967168 > 31
> pr46309.c.114t.reassoc1: into _13 = _18 | _15;
> pr46309.c.116t.reassoc1:Optimizing range tests a_2(D) -[1, 1] and -[2,
> 2] and -[3, 3] and -[4, 4]
> pr46309.c.116t.reassoc1: into (unsigned int) a_2(D) + 4294967295 > 3
> pr46309.c.116t.reassoc1:Optimizing range tests a_2(D) -[1, 1] and -[2,
> 2] and -[3, 3] and -[4, 4]
> pr46309.c.116t.reassoc1: into (unsigned int) a_2(D) + 4294967295 > 3
> pr46309.c.116t.reassoc1:Optimizing range tests a_3(D) -[0, 31] and -[64,
> 95]
> pr46309.c.116t.reassoc1: into (a_3(D) & 4294967231) > 31
> pr46309.c.116t.reassoc1:Optimizing range tests a_5(D) -[0, 31] and -[64,
> 95]
> pr46309.c.116t.reassoc1: into (a_5(D) & 4294967231) > 31
> pr46309.c.116t.reassoc1:Optimizing range tests a_5(D) -[128, 159] and
> -[192, 223]
> pr46309.c.116t.reassoc1: into (a_5(D) & 4294967231) + 4294967168 > 31
>
>
> Bootstrapped and regression testing on x86-64-linux-gnu and
> ppc64le-linux-gnu doesn't have any new regressions. Also did regression
> testing arm variants which has branch cost greater than 1
>
> Is this OK for trunk.
>
> Thanks,
> Kugan
>
> gcc/ChangeLog:
>
> 2016-06-01  Kugan Vivekanandarajah  <kuganv@linaro.org>
>
>     PR middle-end/66726
>     * tree-ssa-reassoc.c (optimize_vec_cond_expr): Handle tcc_compare stmt
>     whose result is used in PHI
>     (final_range_test_p): Likewise.
>     (maybe_optimize_range_tests): Likewise.
OK for the trunk.

Thanks for your patience,
Jeff

      reply	other threads:[~2016-06-22  3:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 10:46 kugan
2016-06-22  3:16 ` Jeff Law [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=f149502d-530e-729e-d782-c53b80879c35@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kugan.vivekanandarajah@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).