--- Comment #5 from Martin Liška <marxin at gcc dot> ---
(In reply to Marc Glisse from comment #4)
> Note that this is good for identity, but we could also turn a map 0->3,
> 1->4, 5->8 into x->x+3, or generally any map (with an unreachable default
> case) into a polynomial (or some other simple function), the cost of which
> might be higher or lower than the jump table. It probably isn't worth going
> too far in that direction though.

Sure, it's also described here:

It's a bit different as it handles situations like

switch (x)
case 16:
case 32:

where one should perform operation to index to have a consecutive jump table.
But it touches similar.

Reply via email to