aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-01-09 09:42:22 +0100
committerRichard Biener <rguenther@suse.de>2023-01-11 13:13:50 +0100
commitf99d7d669eaa2830eb5878df4da67e77ec791522 (patch)
treefeea70ad9071ddde1440fbb8c422c964fa23699d /gcc/function.cc
parentb39c1bea5bae9aee1df25cab1064f983b9ec6941 (diff)
downloadgcc-f99d7d669eaa2830eb5878df4da67e77ec791522.zip
gcc-f99d7d669eaa2830eb5878df4da67e77ec791522.tar.gz
gcc-f99d7d669eaa2830eb5878df4da67e77ec791522.tar.bz2
tree-optimization/107767 - not profitable switch conversion
When the CFG has not merged equal PHI defs in a switch stmt the cost model from switch conversion gets off and we prefer a jump table over branches. The following fixes that by recording cases that will be merged later and more appropriately counting unique values. PR tree-optimization/107767 * tree-cfgcleanup.cc (phi_alternatives_equal): Export. * tree-cfgcleanup.h (phi_alternatives_equal): Declare. * tree-switch-conversion.cc (switch_conversion::collect): Count unique non-default targets accounting for later merging opportunities. * gcc.dg/tree-ssa/pr107767.c: New testcase.
Diffstat (limited to 'gcc/function.cc')
0 files changed, 0 insertions, 0 deletions