On 08/03/2016 07:47 AM, Richard Biener wrote:
On Wed, Aug 3, 2016 at 6:00 AM, Patrick Palka <patr...@parcs.ath.cx> wrote:
VRP currently has functionality to eliminate case labels that lie
completely outside of the switch operand's value range.  This patch
complements this functionality by teaching VRP to also truncate the case
label ranges that partially overlap with the operand's value range.

Bootstrapped and regtested on x86_64-pc-linux-gnu.  Does this look like
a reasonable optimization?  Admittedly, its effect will almost always be
negligible except in cases where a case label range spans a large number
of values which is a pretty rare thing.  The optimization triggered
about 250 times during bootstrap.

I think it's most useful when the range collapses to a single value.
It's mostly a code/rodata savings. It's something I've wanted for a long time, though the priority dropped considerably once the PA died as an architecture :-)

Jeff

Reply via email to