From patchwork Wed Sep 22 09:24:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 65412 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 47F07B70A5 for ; Wed, 22 Sep 2010 19:24:59 +1000 (EST) Received: (qmail 21423 invoked by alias); 22 Sep 2010 09:24:57 -0000 Received: (qmail 21414 invoked by uid 22791); 22 Sep 2010 09:24:56 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Sep 2010 09:24:51 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id CCE8293717 for ; Wed, 22 Sep 2010 11:24:48 +0200 (CEST) Date: Wed, 22 Sep 2010 11:24:48 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH][1/n] Minor pass re-orgs Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This tries to remove two seemingly useless passes, a CCP and copyprop combo right before PRE and right after DOM. Now it happens that at -O1 PRE is not run (not even in FRE mode), so the argument that this would do constant propagation already is moot (and it causes gcc.dg/uninit-2.c to fail at -O1). So instead of removing the combo this patch removes the copyprop and moves the CCP pass right after loop optimizations where it helps to clean up code from the unroller and will re-compute alignment information for new code snippets emitted. Looking at this I noticed that we do not have a sensible pass pipeline at -O1 at all, but I recognize that people may want to have -O2 equal to -O1 plus individual optimizations. The plan with pass re-orgs for 4.6 is to have FRE during early optimizations, and my idea for -O1 (what is -O1 about again?) would be to cut off after early optimziations and go right to expansion. I will try to experiment with the feasibility of the latter next. Well, that is, if -O1 is really about compile-speed plus basic optimizations that keep debugging working. Is it? Bootstrapped and tested on x86_64-unknown-linux-gnu, I'll leave this for general comments for now. Thanks, Richard. 2010-09-22 Richard Guenther * passes.c (init_optimization_passes): Move CCP from before PRE to after loop optimizations. Remove copyprop before PRE. Index: gcc/passes.c =================================================================== --- gcc/passes.c (revision 164482) +++ gcc/passes.c (working copy) @@ -882,8 +882,6 @@ init_optimization_passes (void) NEXT_PASS (pass_forwprop); NEXT_PASS (pass_phiopt); NEXT_PASS (pass_object_sizes); - NEXT_PASS (pass_ccp); - NEXT_PASS (pass_copy_prop); NEXT_PASS (pass_cse_sincos); NEXT_PASS (pass_optimize_bswap); NEXT_PASS (pass_split_crit_edges); @@ -928,6 +926,7 @@ init_optimization_passes (void) NEXT_PASS (pass_iv_optimize); NEXT_PASS (pass_tree_loop_done); } + NEXT_PASS (pass_ccp); NEXT_PASS (pass_cse_reciprocals); NEXT_PASS (pass_reassoc); NEXT_PASS (pass_vrp);