From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31887 invoked by alias); 28 Aug 2010 08:23:29 -0000 Received: (qmail 31874 invoked by uid 22791); 28 Aug 2010 08:23:28 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 28 Aug 2010 08:23:24 +0000 Received: by qyk4 with SMTP id 4so4179110qyk.20 for ; Sat, 28 Aug 2010 01:23:22 -0700 (PDT) Received: by 10.224.67.81 with SMTP id q17mr1182636qai.120.1282983802054; Sat, 28 Aug 2010 01:23:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.19.193 with HTTP; Sat, 28 Aug 2010 01:22:58 -0700 (PDT) In-Reply-To: References: From: "Paulo J. Matos" Date: Sat, 28 Aug 2010 11:08:00 -0000 Message-ID: Subject: Re: Clustering switch cases To: Richard Guenther Cc: Ian Lance Taylor , gcc@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-08/txt/msg00419.txt.bz2 On Fri, Aug 27, 2010 at 4:03 PM, Richard Guenther 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). =C2=A0Thus, lower swit= ch > 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. --=20 PMatos