Add if-chain to switch conversion pass.
gcc/ChangeLog:
PR tree-optimization/14799
PR ipa/88702
* Makefile.in: Add new gimple-if-to-switch.o.
* common.opt: Add new option.
* dbgcnt.def (DEBUG_COUNTER): Add new debug counter.
* doc/invoke.texi: Document -fconvert-if-to-switch.
* opts.c: Add -fconvert-if-to-switch at OPT_LEVELS_2_PLUS.
* passes.def: Register new pass.
* timevar.def (TV_TREE_IF_TO_SWITCH): Add new time variable.
* tree-pass.h (make_pass_if_to_switch): New.
* tree-switch-conversion.h: New file.
* gimple-if-to-switch.cc: New file.
gcc/testsuite/ChangeLog:
PR tree-optimization/14799
PR ipa/88702
* gcc.dg/tree-ssa/reassoc-32.c: Add -fno-convert-if-to-switch.
* gcc.dg/tree-ssa/if-to-switch-1.c: New test.
* gcc.dg/tree-ssa/if-to-switch-2.c: Likewise.
* gcc.dg/tree-ssa/if-to-switch-3.c: Likewise.
* gcc.dg/tree-ssa/if-to-switch-4.c: Likewise.
* gcc.dg/tree-ssa/if-to-switch-5.c: Likewise.
* gcc.dg/tree-ssa/if-to-switch-6.c: Likewise.
* gcc.dg/tree-ssa/if-to-switch-7.c: Likewise.
* gcc.dg/tree-ssa/if-to-switch-8.c: Likewise.