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/switch-lowering-fix-profile)] Fix first part of problems. Date: Tue, 25 Jan 2022 16:00:41 +0000 (GMT) [thread overview] Message-ID: <20220125160041.47CF8385B80B@sourceware.org> (raw) https://gcc.gnu.org/g:192ac7a1ff2d248e508055a048b7972a485edda2 commit 192ac7a1ff2d248e508055a048b7972a485edda2 Author: Martin Liska <mliska@suse.cz> Date: Mon Jan 24 15:45:38 2022 +0100 Fix first part of problems. Diff: --- gcc/tree-switch-conversion.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/tree-switch-conversion.cc b/gcc/tree-switch-conversion.cc index 670397c87e4..7607f5ae019 100644 --- a/gcc/tree-switch-conversion.cc +++ b/gcc/tree-switch-conversion.cc @@ -2162,6 +2162,7 @@ switch_decision_tree::emit_cmp_and_jump_insns (basic_block bb, tree op0, edge false_edge = split_block (bb, cond); false_edge->flags = EDGE_FALSE_VALUE; false_edge->probability = prob.invert (); + false_edge->dest->count = bb->count.apply_probability (prob.invert ()); edge true_edge = make_edge (bb, label_bb, EDGE_TRUE_VALUE); true_edge->probability = prob; @@ -2192,6 +2193,7 @@ switch_decision_tree::do_jump_if_equal (basic_block bb, tree op0, tree op1, edge false_edge = split_block (bb, cond); false_edge->flags = EDGE_FALSE_VALUE; false_edge->probability = prob.invert (); + false_edge->dest->count = bb->count.apply_probability (prob.invert ()); edge true_edge = make_edge (bb, label_bb, EDGE_TRUE_VALUE); true_edge->probability = prob; @@ -2262,6 +2264,7 @@ switch_decision_tree::emit_case_nodes (basic_block bb, tree index, p = ((node->m_right->m_c->m_subtree_prob + default_prob.apply_scale (1, 2)) / (node->m_c->m_subtree_prob + default_prob)); + test_bb->count = bb->count.apply_probability (p); bb = emit_cmp_and_jump_insns (bb, index, node->m_c->get_high (), GT_EXPR, test_bb, p, loc); default_prob = default_prob.apply_scale (1, 2); @@ -2359,6 +2362,7 @@ switch_decision_tree::emit_case_nodes (basic_block bb, tree index, right_prob = node->m_right->m_c->m_subtree_prob; p = ((right_prob + default_prob.apply_scale (1, 2)) / (node->m_c->m_subtree_prob + default_prob)); + test_bb->count = bb->count.apply_probability (p); bb = emit_cmp_and_jump_insns (bb, index, node->m_c->get_high (), GT_EXPR, test_bb, p, loc);
reply other threads:[~2022-01-25 16:00 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220125160041.47CF8385B80B@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).