public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH] Avoid unnecessary epilogues from tree_unroll_loop
       [not found] <20230309103756.43AFB3850213@sourceware.org>
@ 2023-03-09 11:39 ` Richard Sandiford
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Sandiford @ 2023-03-09 11:39 UTC (permalink / raw)
  To: Richard Biener via Gcc-patches; +Cc: Richard Biener

Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> 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?

Oops, no, looks like a mistake.  Thanks for the fix.

Richard

> 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;
>      }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] Avoid unnecessary epilogues from tree_unroll_loop
@ 2023-03-09 10:37 Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-03-09 10:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: richard.sandiford

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-09 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230309103756.43AFB3850213@sourceware.org>
2023-03-09 11:39 ` [PATCH] Avoid unnecessary epilogues from tree_unroll_loop Richard Sandiford
2023-03-09 10:37 Richard Biener

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).