From patchwork Fri Jan 14 00:23:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Grosser X-Patchwork-Id: 78854 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 9D87EB70D5 for ; Fri, 14 Jan 2011 11:23:15 +1100 (EST) Received: (qmail 28181 invoked by alias); 14 Jan 2011 00:23:14 -0000 Received: (qmail 28173 invoked by uid 22791); 14 Jan 2011 00:23:12 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, TW_SV, TW_TM X-Spam-Check-By: sourceware.org Received: from out1.smtp.messagingengine.com (HELO out1.smtp.messagingengine.com) (66.111.4.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Jan 2011 00:23:03 +0000 Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.messagingengine.com (Postfix) with ESMTP id AE38A204C2; Thu, 13 Jan 2011 19:23:01 -0500 (EST) Received: from frontend1.messagingengine.com ([10.202.2.160]) by compute3.internal (MEProxy); Thu, 13 Jan 2011 19:23:01 -0500 Received: from [128.146.186.86] (dhcp-128-146-186-86.osuwireless.ohio-state.edu [128.146.186.86]) by mail.messagingengine.com (Postfix) with ESMTPSA id 67F47404AEB; Thu, 13 Jan 2011 19:23:01 -0500 (EST) Message-ID: <4D2F9769.2090902@fim.uni-passau.de> Date: Thu, 13 Jan 2011 19:23:05 -0500 From: Tobias Grosser User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9pre) Gecko/20100802 Lightning/1.0b2 Lanikai/3.1.2pre MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org, GCC GRAPHITE , Vladimir Kargov Subject: [Graphite] Commited patches for new Scop dection 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 Hi, after we finished the support for cloog-isl in graphite, I committed those three patches contributed by Vladimir Kargov during the Google Summer of Code to the graphite branch. The passed the nightly testers and will be merged back to trunk soon. Thanks Vladimir for working on this. Cheers Tobi From 481b4e7afafac81e1f1b03faa34bbfdb4781832a Mon Sep 17 00:00:00 2001 From: grosser Date: Wed, 5 Jan 2011 17:06:13 +0000 Subject: [PATCH 3/3] New scop detection: Support for BBs with conditonal statements * graphite-scop-detection.c (is_valid_stmt_p): Pass the entry basic block instead of region start to the instantiation. (is_valid_bb_p): Add support for basic blocks with conditional statements. (find_scops_new): Recalculate dominance info before SCOP detection. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@168523 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.graphite | 9 +++++++++ gcc/graphite-scop-detection.c | 27 ++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index f40f968..c19b30a 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,14 @@ 2011-01-05 Vladimir Kargov + * graphite-scop-detection.c (is_valid_stmt_p): Pass the entry basic + block instead of region start to the instantiation. + (is_valid_bb_p): Add support for basic blocks with conditional + statements. + (find_scops_new): Recalculate dominance info before SCOP + detection. + +2011-01-05 Vladimir Kargov + * graphite-scop-detection.c (get_outermost_loop_in_region): New. (is_valid_loop_p): Correct loop passed to stmt_has_simple_data_refs_p diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 5381dba..c02c90a 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1392,7 +1392,10 @@ is_valid_stmt_p (refined_region_p region, basic_block bb, gimple stmt) return false; FOR_EACH_SSA_TREE_OPERAND (op, stmt, op_iter, SSA_OP_ALL_USES) - if (!is_valid_expr_p (region, loop, op) + /* Follow the old behaviour and always use the entry BB as + instantiate_below during instantiation. */ + /* if (!is_valid_expr_p (region, loop, op) */ + if (!graphite_can_represent_expr (ENTRY_BLOCK_PTR, loop, op) /* We can not handle REAL_TYPE. Failed for pr39260. */ || TREE_CODE (TREE_TYPE (op)) == REAL_TYPE) return false; @@ -1419,6 +1422,7 @@ static bool is_valid_bb_p (refined_region_p region, basic_block bb) { int succ_len = VEC_length (edge, bb->succs); + int pred_len = VEC_length (edge, bb->preds); gimple_stmt_iterator gsi; struct loop *loop = bb->loop_father; @@ -1427,15 +1431,19 @@ is_valid_bb_p (refined_region_p region, basic_block bb) if (succ_len > 2 || succ_len == 0) return false; - if (succ_len == 2) + /* Ensure that the basic block with two or more entry edges conforms to the + requirements of structured code. */ + if (pred_len >= 2) { - /* Is BB the exiting block of a loop? */ - if (!loop_exits_from_bb_p (loop, bb)) + basic_block dom = get_immediate_dominator (CDI_DOMINATORS, bb); + basic_block post = get_immediate_dominator (CDI_POST_DOMINATORS, dom); + + if (post != bb) return false; } - /* BB is the header of a loop. Do validity checks on it. */ - if (bb == bb->loop_father->header && !is_valid_loop_p (region, loop)) + /* BB is the header of a loop. */ + if (bb == loop->header && !is_valid_loop_p (region, loop)) return false; /* Are there any harmful BBs in the region? */ @@ -1490,7 +1498,12 @@ find_scops_new (VEC (sd_region, heap) **sd_scops) VEC (refined_region_p, heap) *check = VEC_alloc (refined_region_p, heap, 3); /* Build new region tree. */ - refined_region_p new_region = calculate_region_tree (); + refined_region_p new_region; + + calculate_dominance_info (CDI_DOMINATORS); + calculate_dominance_info (CDI_POST_DOMINATORS); + + new_region = calculate_region_tree (); /* Print the region tree with all the basic blocks its regions contain. */ if (dump_file && (dump_flags & TDF_DETAILS)) -- 1.7.1