On Fri, Aug 27, 2010 at 4:03 PM, Richard Guenther <richard.guent...@gmail.com> wrote: > > In fact we might want to move switch optimization up to the tree level > (just because it's way easier to deal with there). Thus, lower switch > to a mixture of binary tree & jump-tables (possibly using perfect > hashing). >
Doing the optimisation at the tree-level was exactly my initial idea. By splitting the switches at the tree-level, before expand_case, would then allow for expand_case to transform it either to a jump table or binary tree depending on the situation. I will be looking at the patch Rahul posted and will try to see if I can improve on it. -- PMatos