public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/loop-unswitch-improvement)] Simplify early exit. Date: Mon, 22 Nov 2021 12:44:48 +0000 (GMT) [thread overview] Message-ID: <20211122124448.36C843858425@sourceware.org> (raw) https://gcc.gnu.org/g:e55ae6cf30533a1cc32217a245fca57c0efad014 commit e55ae6cf30533a1cc32217a245fca57c0efad014 Author: Martin Liska <mliska@suse.cz> Date: Tue Nov 16 10:45:16 2021 +0100 Simplify early exit. Diff: --- gcc/tree-ssa-loop-unswitch.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c index e465e14a6ab..fb5bcf5a13d 100644 --- a/gcc/tree-ssa-loop-unswitch.c +++ b/gcc/tree-ssa-loop-unswitch.c @@ -366,10 +366,7 @@ tree_unswitch_single_loop (class loop *loop, int num, gimple_ranger *ranger, fprintf (dump_file, ";; Not unswitching anymore, hit max level\n"); if (found == loop->num_nodes) - { - free (bbs); - return changed; - } + goto exit; break; } @@ -382,6 +379,7 @@ tree_unswitch_single_loop (class loop *loop, int num, gimple_ranger *ranger, gimple_cond_set_condition_from_tree (as_a <gcond *> (stmt), boolean_true_node); delete predicate; + predicate = NULL; changed = true; } else if (folded != NULL_TREE && integer_zerop (folded)) @@ -390,6 +388,7 @@ tree_unswitch_single_loop (class loop *loop, int num, gimple_ranger *ranger, gimple_cond_set_condition_from_tree (as_a <gcond *> (stmt), boolean_false_node); delete predicate; + predicate = NULL; changed = true; } /* Do not unswitch too much. */ @@ -477,11 +476,7 @@ tree_unswitch_single_loop (class loop *loop, int num, gimple_ranger *ranger, break; if (found == loop->num_nodes) - { - free (bbs); - delete predicate; - return changed; - } + goto exit; } if (dump_file && (dump_flags & TDF_DETAILS)) @@ -497,9 +492,7 @@ tree_unswitch_single_loop (class loop *loop, int num, gimple_ranger *ranger, if (!nloop) { free_original_copy_tables (); - delete predicate; - free (bbs); - return changed; + goto exit; } /* Update the SSA form after unswitching. */ @@ -512,6 +505,11 @@ tree_unswitch_single_loop (class loop *loop, int num, gimple_ranger *ranger, delete predicate; free (bbs); return true; + +exit: + free (bbs); + delete predicate; + return changed; } /* Unswitch a LOOP w.r. to given basic block UNSWITCH_ON. We only support
next reply other threads:[~2021-11-22 12:44 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-22 12:44 Martin Liska [this message] -- strict thread matches above, loose matches on Subject: below -- 2021-11-19 14:34 Martin Liska 2021-11-19 13:53 Martin Liska 2021-11-16 9:46 Martin Liska
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=20211122124448.36C843858425@sourceware.org \ --to=marxin@gcc.gnu.org \ --cc=gcc-cvs@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: linkBe 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).