From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17387 invoked by alias); 23 Aug 2012 11:43:01 -0000 Received: (qmail 17378 invoked by uid 22791); 23 Aug 2012 11:43:00 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Aug 2012 11:42:47 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/46590] [4.6/4.7/4.8 Regression] long compile time with -O2 and many loops Date: Thu, 23 Aug 2012 11:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: compile-time-hog, memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-08/txt/msg01610.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46590 --- Comment #31 from Richard Guenther 2012-08-23 11:41:50 UTC --- Btw, I have experimented with Index: tree-into-ssa.c =================================================================== --- tree-into-ssa.c (revision 190594) +++ tree-into-ssa.c (working copy) @@ -3224,11 +3224,35 @@ update_ssa (unsigned update_flags) bitmap_head *dfs; /* If the caller requested PHI nodes to be added, compute - dominance frontiers. */ + dominance frontiers for all interesting blocks + up to the dominating start_bb. */ dfs = XNEWVEC (bitmap_head, last_basic_block); FOR_EACH_BB (bb) bitmap_initialize (&dfs[bb->index], &bitmap_default_obstack); - compute_dominance_frontiers (dfs); + EXECUTE_IF_SET_IN_BITMAP (blocks_to_update, 0, i, bi) + { + basic_block b = BASIC_BLOCK (i); + edge_iterator ei; + edge p; + if (EDGE_COUNT (b->preds) >= 2) + FOR_EACH_EDGE (p, ei, b->preds) + { + basic_block runner = p->src; + basic_block domsb; + if (runner == start_bb) + continue; + + domsb = get_immediate_dominator (CDI_DOMINATORS, b); + while (runner != domsb) + { + if (!bitmap_set_bit (&dfs[runner->index], + b->index)) + break; + runner = get_immediate_dominator (CDI_DOMINATORS, + runner); + } + } + } if (sbitmap_first_set_bit (old_ssa_names) >= 0) { which helps reducing the time spent in computing dominance frontiers. But as we no longer have bitmaps but bitmap_heads in dfs it's hard to verify we only ever access dfs for entries we computed ... but we should, looking at how compute_idf works(?).