public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Cc: richard.sandiford@arm.com
Subject: [PATCH] Avoid unnecessary epilogues from tree_unroll_loop
Date: Thu, 9 Mar 2023 10:37:13 +0000 (UTC)	[thread overview]
Message-ID: <20230309103713.yf9NjrynqQOnWHon_6K_WUD5lDab9zfPL9bh4xYVE2E@z> (raw)

The following fixes the condition determining whether we need an
epilogue.

When r12-2429-g62acc72a957b56 introduced this check I didn't notice
the odd condition on review.  Richard - do you remember if this
was on purpose?

I've noticed the mismatch with gcc.dg/tree-ssa/predcom-1.c for example.

Bootstrapped and tested on x86_64-unknown-linux-gnu, queued for stage1.

Richard.

	* tree-ssa-loop-manip.cc (determine_exit_conditions): Fix
	no epilogue condition.
---
 gcc/tree-ssa-loop-manip.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-ssa-loop-manip.cc b/gcc/tree-ssa-loop-manip.cc
index c804a7353d5..a52277abdbf 100644
--- a/gcc/tree-ssa-loop-manip.cc
+++ b/gcc/tree-ssa-loop-manip.cc
@@ -1010,7 +1010,7 @@ determine_exit_conditions (class loop *loop, class tree_niter_desc *desc,
       /* Convert the latch count to an iteration count.  */
       tree niter = fold_build2 (PLUS_EXPR, type, desc->niter,
 				build_one_cst (type));
-      if (multiple_of_p (type, niter, bigstep))
+      if (multiple_of_p (type, niter, build_int_cst (type, factor)))
 	return;
     }
 
-- 
2.35.3

             reply	other threads:[~2023-03-09 10:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 10:37 Richard Biener [this message]
     [not found] <20230309103756.43AFB3850213@sourceware.org>
2023-03-09 11:39 ` Richard Sandiford

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=20230309103713.yf9NjrynqQOnWHon_6K_WUD5lDab9zfPL9bh4xYVE2E@z \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.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).