public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/105735] GCC failed to reduce &= loop_inv in loop.
Date: Tue, 20 Sep 2022 06:36:09 +0000	[thread overview]
Message-ID: <bug-105735-4-X6vkbYZSml@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105735-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105735

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Kong Lingling <konglin1@gcc.gnu.org>:

https://gcc.gnu.org/g:3a035f1932eeb26f997cf28a5c752617dd09cb91

commit r13-2729-g3a035f1932eeb26f997cf28a5c752617dd09cb91
Author: konglin1 <lingling.kong@intel.com>
Date:   Tue Sep 20 13:58:35 2022 +0800

    middle-end: handle bitop with an invariant induction.[PR105735]

    Enhance final_value_replacement_loop to handle bitop
    with an invariant induction.

    This patch will enable below optimization:

    {
    -  long unsigned int bit;
    -
    -  <bb 2> [local count: 32534376]:
    -
    -  <bb 3> [local count: 1041207449]:
    -  # tmp_10 = PHI <tmp_7(5), tmp_4(D)(2)>
    -  # bit_12 = PHI <bit_8(5), 0(2)>
    -  tmp_7 = bit2_6(D) & tmp_10;
    -  bit_8 = bit_12 + 1;
    -  if (bit_8 != 32)
    -    goto <bb 5>; [96.97%]
    -  else
    -    goto <bb 4>; [3.03%]
    -
    -  <bb 5> [local count: 1009658865]:
    -  goto <bb 3>; [100.00%]
    -
    -  <bb 4> [local count: 32534376]:
    -  # tmp_11 = PHI <tmp_7(3)>
    -  return tmp_11;
    +  tmp_11 = tmp_4 (D) & bit2_6 (D);
    +  return tmp_11;

    }

    gcc/ChangeLog:

            PR middle-end/105735
            * tree-scalar-evolution.cc
            (analyze_and_compute_bitop_with_inv_effect): New function.
            (final_value_replacement_loop): Enhanced to handle bitop
            with inv induction.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr105735-1.c: New test.
            * gcc.target/i386/pr105735-2.c: New test.

  parent reply	other threads:[~2022-09-20  6:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26  7:54 [Bug tree-optimization/105735] New: " crazylht at gmail dot com
2022-05-26  8:29 ` [Bug tree-optimization/105735] " pinskia at gcc dot gnu.org
2022-09-20  6:36 ` cvs-commit at gcc dot gnu.org [this message]
2022-09-22  2:04 ` lingling.kong7 at gmail dot com
2023-11-14  1:28 ` cvs-commit at gcc dot gnu.org

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=bug-105735-4-X6vkbYZSml@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).