From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11966 invoked by alias); 1 Sep 2010 08:39:00 -0000 Received: (qmail 11951 invoked by uid 22791); 1 Sep 2010 08:38:58 -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-iw0-f175.google.com (HELO mail-iw0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Sep 2010 08:38:53 +0000 Received: by iwn2 with SMTP id 2so6797924iwn.20 for ; Wed, 01 Sep 2010 01:38:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.150.7 with SMTP id w7mr8784102ibv.14.1283330331608; Wed, 01 Sep 2010 01:38:51 -0700 (PDT) Received: by 10.231.13.77 with HTTP; Wed, 1 Sep 2010 01:38:51 -0700 (PDT) In-Reply-To: <201009010034.18924.paul@codesourcery.com> References: <201009010034.18924.paul@codesourcery.com> Date: Wed, 01 Sep 2010 08:39:00 -0000 Message-ID: Subject: Re: Clustering switch cases From: Richard Guenther To: Paul Brook Cc: gcc@gcc.gnu.org, "Paulo J. Matos" , Ian Lance Taylor Content-Type: text/plain; charset=ISO-8859-1 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-09/txt/msg00002.txt.bz2 On Wed, Sep 1, 2010 at 1:34 AM, Paul Brook 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). =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'd kinda hope that doing the optimization at the tree level means expand= _case > doesn't have to handle both types. =A0The tree code converts sparse case = ranges > to explicit conditionals (or a switch on a compact perfect hash), so anyt= hing > left to RTL expansion must be a jump table. Yes, that was my idea. Richard. > Paul >