diff options
author | Martin Liska <mliska@suse.cz> | 2018-08-27 14:17:54 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-08-27 12:17:54 +0000 |
commit | dbdfaaba50c5d7d85c1e64751988d00114fd7d6b (patch) | |
tree | 5c8f893e4a884022f9007c23ad181990fb45cdce /gcc/tree-switch-conversion.h | |
parent | 61ff5d6f4ed5000ee427e054ee803bc8f5535bdd (diff) | |
download | gcc-dbdfaaba50c5d7d85c1e64751988d00114fd7d6b.zip gcc-dbdfaaba50c5d7d85c1e64751988d00114fd7d6b.tar.gz gcc-dbdfaaba50c5d7d85c1e64751988d00114fd7d6b.tar.bz2 |
Fix probabilities for jump table (PR tree-optimization/86702).
2018-08-27 Martin Liska <mliska@suse.cz>
PR tree-optimization/86702
* tree-switch-conversion.c (jump_table_cluster::emit):
Make probabilities even for values in jump table
according to number of cases handled.
(switch_decision_tree::compute_cases_per_edge): Pass
argument to reset_out_edges_aux function.
(switch_decision_tree::analyze_switch_statement): Likewise.
* tree-switch-conversion.h (switch_decision_tree::reset_out_edges_aux):
Make it static.
From-SVN: r263877
Diffstat (limited to 'gcc/tree-switch-conversion.h')
-rw-r--r-- | gcc/tree-switch-conversion.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-conversion.h index 4beac78..af2f47a 100644 --- a/gcc/tree-switch-conversion.h +++ b/gcc/tree-switch-conversion.h @@ -513,10 +513,6 @@ struct switch_decision_tree /* Attempt to expand CLUSTERS as a decision tree. Return true when expanded. */ bool try_switch_expansion (vec<cluster *> &clusters); - - /* Reset the aux field of all outgoing edges of switch basic block. */ - inline void reset_out_edges_aux (); - /* Compute the number of case labels that correspond to each outgoing edge of switch statement. Record this information in the aux field of the edge. */ @@ -576,6 +572,9 @@ struct switch_decision_tree basic_block label_bb, profile_probability prob); + /* Reset the aux field of all outgoing edges of switch basic block. */ + static inline void reset_out_edges_aux (gswitch *swtch); + /* Switch statement. */ gswitch *m_switch; @@ -838,9 +837,9 @@ struct switch_conversion }; void -switch_decision_tree::reset_out_edges_aux () +switch_decision_tree::reset_out_edges_aux (gswitch *swtch) { - basic_block bb = gimple_bb (m_switch); + basic_block bb = gimple_bb (swtch); edge e; edge_iterator ei; FOR_EACH_EDGE (e, ei, bb->succs) |