public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6873] rtl-optimization/109237 - speedup bb_is_just_return
@ 2023-03-27  6:57 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-03-27  6:57 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:776a5bb5894315ab144dc74222fc580fde8fdd87

commit r13-6873-g776a5bb5894315ab144dc74222fc580fde8fdd87
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Mar 22 10:05:19 2023 +0100

    rtl-optimization/109237 - speedup bb_is_just_return
    
    For the testcase bb_is_just_return is on top of the profile, changing
    it to walk BB insns backwards puts it off the profile.  That's because
    in the forward walk you have to process possibly many debug insns
    but in a backward walk you very likely run into control insns first.
    
            PR rtl-optimization/109237
            * cfgcleanup.cc (bb_is_just_return): Walk insns backwards.

Diff:
---
 gcc/cfgcleanup.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/cfgcleanup.cc b/gcc/cfgcleanup.cc
index 194e0e5de12..4cd33878ef3 100644
--- a/gcc/cfgcleanup.cc
+++ b/gcc/cfgcleanup.cc
@@ -2608,7 +2608,7 @@ bb_is_just_return (basic_block bb, rtx_insn **ret, rtx_insn **use)
   if (bb == EXIT_BLOCK_PTR_FOR_FN (cfun))
     return false;
 
-  FOR_BB_INSNS (bb, insn)
+  FOR_BB_INSNS_REVERSE (bb, insn)
     if (NONDEBUG_INSN_P (insn))
       {
 	rtx pat = PATTERN (insn);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-27  6:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27  6:57 [gcc r13-6873] rtl-optimization/109237 - speedup bb_is_just_return 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).