[PATCH 2/3] Fix probability for bit-tests.

marxin mliska@suse.cz
Tue Aug 14 09:04:00 GMT 2018


The patch set even probability to bit test based on number of
cases which are handled on each edge.

gcc/ChangeLog:

2018-08-06  Martin Liska  <mliska@suse.cz>

	* tree-switch-conversion.c (bit_test_cluster::find_bit_tests):
        Add new argument to bit_test_cluster constructor.
	(bit_test_cluster::emit): Set bits really number of values
        handlel by a test.
	(bit_test_cluster::hoist_edge_and_branch_if_true): Add
        probability argument.
	* tree-switch-conversion.h (struct bit_test_cluster):
        Add m_handles_entire_switch.

gcc/testsuite/ChangeLog:

2018-08-06  Martin Liska  <mliska@suse.cz>

	* gcc.dg/tree-ssa/switch-2.c: New test.
---
 gcc/testsuite/gcc.dg/tree-ssa/switch-2.c | 25 +++++++++++++
 gcc/tree-switch-conversion.c             | 46 +++++++++++++++++-------
 gcc/tree-switch-conversion.h             | 12 +++++--
 3 files changed, 67 insertions(+), 16 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/switch-2.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-probability-for-bit-tests.patch
Type: text/x-patch
Size: 6822 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180814/5d2bf098/attachment.bin>


More information about the Gcc-patches mailing list