On 09/05/2018 11:31 AM, Richard Biener wrote: > On Wed, Sep 5, 2018 at 10:31 AM Martin Liška <mli...@suse.cz> wrote: >> >> Hi. >> >> It's beneficial to group cases before switch lowering machinery >> is making a decision what to do with a switch. >> >> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. >> >> Ready to be installed? > > Hmm, do we want to do this at O0? There it should be redundant given > CFG build already performs it? We also perform it at .optimized > (execute_cleanup_cfg_post_optimizing) plus when we redirect some > edges and then call record_case_labels.
Sure, I'll not do it with O0. I'm going to install the patch. Martin > > Otherwise OK. > > Richard. > >> Martin >> >> >> gcc/ChangeLog: >> >> 2018-09-04 Martin Liska <mli...@suse.cz> >> >> PR tree-optimization/87205 >> * tree-switch-conversion.c (pass_lower_switch::execute): >> Group cases for switch statements. >> >> gcc/testsuite/ChangeLog: >> >> 2018-09-04 Martin Liska <mli...@suse.cz> >> >> PR tree-optimization/87205 >> * gcc.dg/tree-ssa/pr87205-2.c: New test. >> * gcc.dg/tree-ssa/pr87205.c: New test. >> --- >> gcc/testsuite/gcc.dg/tree-ssa/pr87205-2.c | 18 ++++++++++++++++++ >> gcc/testsuite/gcc.dg/tree-ssa/pr87205.c | 21 +++++++++++++++++++++ >> gcc/tree-switch-conversion.c | 8 ++++++-- >> 3 files changed, 45 insertions(+), 2 deletions(-) >> create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr87205-2.c >> create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr87205.c >> >>