From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13701 invoked by alias); 24 Sep 2004 10:29:08 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13681 invoked by alias); 24 Sep 2004 10:29:08 -0000 Date: Fri, 24 Sep 2004 10:29:00 -0000 Message-ID: <20040924102908.13680.qmail@sourceware.org> From: "dnovillo at redhat dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040518194300.15524.pinskia@gcc.gnu.org> References: <20040518194300.15524.pinskia@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/15524] [4.0 Regression] jump threading on trees is slow with switch statements with large # of cases X-Bugzilla-Reason: CC X-SW-Source: 2004-09/txt/msg02913.txt.bz2 List-Id: ------- Additional Comments From dnovillo at redhat dot com 2004-09-24 10:29 ------- Subject: Re: [4.0 Regression] jump threading on trees is slow with switch statements with large # of cases On Fri, 2004-09-24 at 02:13, law at redhat dot com wrote: > We can turn that into > > switch (x) > { > case 42: > x = 42; > whatever > } > This is what I'm working with as part of VRP. The idea is to insert ASSERT_EXPR that act as special assignments. I have a WIP patch if you are interested, but I at the moment I'm paying more attention to fixes for 4.0. > 1. Is it really necessary to mark these assignments as undeletable > until late in the SSA path (that's something Kenny suggested > as well). > The ASSERT_EXPRs are naturally undeletable if they are used. When we find: if (x_3 == y_9) { x_4 = ASSERT_EXPR (x_3 == y_9) if (x_4 > 4) ... } If you end up knowing something about y_9, you may be able to fold the inner conditional into a constant. If you never use x_4, then the ASSERT_EXPR is naturally dead and goes away. ASSERT_EXPRs are inserted before we go into SSA and are treated as regular IL elements. VRP would propagate and fold them using the SSA propagator. This part is still to be done. Initially I had fused this with CCP, and that didn't work too well. Diego. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15524