From patchwork Tue Dec 18 18:03:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iyer, Balaji V" X-Patchwork-Id: 207169 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 339182C0085 for ; Wed, 19 Dec 2012 05:04:19 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1356458660; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:CC:Subject:Date:Message-ID:References: In-Reply-To:Content-Type:MIME-Version:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=R+2vq144qu8jfWTuzDEqwlcP6m8=; b=QCSI/XagGlajclV QLG2Zw3XAdmRbd/NqjMh9giZNhlougo1kwhMrmUOZYx/C+3fPjbF28jb8Trt3Qc9 6Iiiep0aUc0AliSj4pXcV4YEUAI//1TW1KBd6tVinHaj+E6Gh3lYCSTNu6pUW4/q 5K9TNWsyAE+tCi6pVd1g1W7iVcog= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-ExtLoop1:Received:Received:From:To:CC:Subject:Date:Message-ID:References:In-Reply-To:Content-Type:MIME-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=V5zLuySNNBSGvC1TWdXfZfh0mxc2sDbjz59oTfznMpUJnCcNLlFRFVyMkOwfnP lIJesrXVTY54n6Yad1H1NLU73w5k3cZDHJECbh8BIo2Miwgc/cboWJQrKNAc67x/ 9WUYNpn1XpvENuCSRXzm4S+wl10EsIqZPAOGAqrbS7xf0=; Received: (qmail 25409 invoked by alias); 18 Dec 2012 18:04:07 -0000 Received: (qmail 25393 invoked by uid 22791); 18 Dec 2012 18:04:04 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Dec 2012 18:03:56 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 18 Dec 2012 10:03:55 -0800 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36]) by fmsmga001.fm.intel.com with ESMTP; 18 Dec 2012 10:03:55 -0800 Received: from fmsmsx102.amr.corp.intel.com ([169.254.2.188]) by FMSMSX105.amr.corp.intel.com ([169.254.5.108]) with mapi id 14.01.0355.002; Tue, 18 Dec 2012 10:03:54 -0800 From: "Iyer, Balaji V" To: Jakub Jelinek CC: "gcc-patches@gcc.gnu.org" Subject: RE: [PATCH][Cilkplus] Fix pragma simd info being lost Date: Tue, 18 Dec 2012 18:03:53 +0000 Message-ID: References: <20121214165843.GZ2315@tucnak.redhat.com> <20121214170830.GA2315@tucnak.redhat.com> In-Reply-To: <20121214170830.GA2315@tucnak.redhat.com> MIME-Version: 1.0 X-IsSubscribed: yes 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 > -----Original Message----- > From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches- > owner@gcc.gnu.org] On Behalf Of Jakub Jelinek > Sent: Friday, December 14, 2012 12:09 PM > To: Iyer, Balaji V > Cc: gcc-patches@gcc.gnu.org > Subject: Re: [PATCH][Cilkplus] Fix pragma simd info being lost > > On Fri, Dec 14, 2012 at 05:01:48PM +0000, Iyer, Balaji V wrote: > > > Why do you think fatal_error is the right thing here? Why doesn't > > > normal error work? Generally, if one function contains 10 #pragma > > > simd loops that require vectorization and 5 out of them aren't > > > vectorized, it is nicer for users to be told about all 5 of them, rather than just > the first one. > > > fatal_error will exit immediately. > > > > The #pragma simd assert requires the compiler to halt compilation if > > the loop is not vectorized. This is why I used fatal_error. The > > default case is noassert. > > The compilation is halted even with error, compiler will exit with non-zero exit > status, won't compile any further functions, etc. Here is a patch where I have replaced all fatal_errors with error_at. Thanks, Balaji V. Iyer. > > Jakub Index: gcc/ChangeLog.cilkplus =================================================================== --- gcc/ChangeLog.cilkplus (revision 194585) +++ gcc/ChangeLog.cilkplus (working copy) @@ -1,3 +1,11 @@ +2012-12-18 Balaji V. Iyer + + * tree-vect-loop.c (vect_determine_vectorization_factor): Replaced all + occurances of "fatal_error" with error_at with vect_location. + (vect_analyze_loop_form): Likewise. + (vect_analyze_loop_operations): Likewise. + (vect_analyze_loop): Likewise. + 2012-12-16 Balaji V. Iyer * tree.h (GTY): Added new field in struct called "decl_auto." Index: gcc/tree-vect-loop.c =================================================================== --- gcc/tree-vect-loop.c (revision 194585) +++ gcc/tree-vect-loop.c (working copy) @@ -233,10 +233,8 @@ } if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - { - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); - } + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } /* here we set the linear info */ @@ -411,10 +409,8 @@ } if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - { - fatal_error ("Loop not vectorized. " - "Exiting as requested by PRAGMA SIMD"); - } + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by PRAGMA SIMD"); return false; } @@ -428,10 +424,8 @@ } if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - { - fatal_error ("Loop not vectorized. " - "Exiting as requested by PRAGMA SIMD"); - } + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by PRAGMA SIMD"); return false; } @@ -468,11 +462,9 @@ scalar_type); } if (flag_enable_cilk && pragma_simd_assert_requested_p - (loop->pragma_simd_index)) - { - fatal_error ("Loop not vectorized. " - "Exiting as requested by PRAGMA SIMD"); - } + (loop->pragma_simd_index)) + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by PRAGMA SIMD"); return false; } /* here we set the linear info */ @@ -517,10 +509,8 @@ } if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - { - fatal_error ("Loop not vectorized. " - "Exiting as requested by PRAGMA SIMD"); - } + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by PRAGMA SIMD"); return false; } @@ -540,10 +530,8 @@ } if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - { - fatal_error ("Loop not vectorized. " - "Exiting as requested by PRAGMA SIMD"); - } + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by PRAGMA SIMD"); return false; } @@ -606,10 +594,8 @@ if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - { - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); - } + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } LOOP_VINFO_VECT_FACTOR (loop_vinfo) = vectorization_factor; @@ -1191,8 +1177,8 @@ "not vectorized: control flow in loop."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return NULL; } @@ -1203,8 +1189,8 @@ "not vectorized: empty loop."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return NULL; } } @@ -1237,8 +1223,8 @@ "not vectorized: multiple nested loops."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return NULL; } @@ -1251,8 +1237,8 @@ "not vectorized: Bad inner loop."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return NULL; } @@ -1264,8 +1250,8 @@ "not vectorized: inner-loop count not invariant."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); destroy_loop_vec_info (inner_loop_vinfo, true); return NULL; } @@ -1277,8 +1263,8 @@ "not vectorized: control flow in loop."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); destroy_loop_vec_info (inner_loop_vinfo, true); return NULL; } @@ -1297,8 +1283,8 @@ "not vectorized: unsupported outerloop form."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); destroy_loop_vec_info (inner_loop_vinfo, true); return NULL; } @@ -1319,16 +1305,16 @@ "not vectorized: multiple exits."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); } else if (EDGE_COUNT (loop->header->preds) != 2) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "not vectorized: too many incoming edges."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); } if (inner_loop_vinfo) destroy_loop_vec_info (inner_loop_vinfo, true); @@ -1347,8 +1333,8 @@ "not vectorized: unexpected loop form."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); if (inner_loop_vinfo) destroy_loop_vec_info (inner_loop_vinfo, true); return NULL; @@ -1371,8 +1357,8 @@ "not vectorized: abnormal loop exit edge."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); if (inner_loop_vinfo) destroy_loop_vec_info (inner_loop_vinfo, true); return NULL; @@ -1387,8 +1373,8 @@ "not vectorized: complicated exit condition."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); if (inner_loop_vinfo) destroy_loop_vec_info (inner_loop_vinfo, true); return NULL; @@ -1402,8 +1388,8 @@ "computed."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); if (inner_loop_vinfo) destroy_loop_vec_info (inner_loop_vinfo, true); return NULL; @@ -1435,8 +1421,8 @@ "not vectorized: number of iterations = 0."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); if (inner_loop_vinfo) destroy_loop_vec_info (inner_loop_vinfo, false); return NULL; @@ -1600,8 +1586,8 @@ "not vectorized: value used after loop."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } @@ -1614,8 +1600,8 @@ "not vectorized: scalar dependence cycle."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } @@ -1636,8 +1622,8 @@ dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, phi, 0); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); } return false; } @@ -1667,8 +1653,8 @@ "vectorize."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } @@ -1692,8 +1678,8 @@ "vectorization factor."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } @@ -1718,8 +1704,8 @@ "profitable."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } @@ -1749,8 +1735,8 @@ "iterations (whichever is more conservative)."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } @@ -1770,8 +1756,8 @@ "conservative)."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } @@ -1788,8 +1774,8 @@ "not vectorized: can't create epilog loop 1."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } if (!slpeel_can_duplicate_loop_p (loop, single_exit (loop))) @@ -1799,8 +1785,8 @@ "not vectorized: can't create epilog loop 2."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return false; } } @@ -2003,10 +1989,9 @@ "bad loop form."); if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - { - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); - } + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); + return NULL; } @@ -2026,8 +2011,8 @@ { if (flag_enable_cilk && pragma_simd_assert_requested_p (loop->pragma_simd_index)) - fatal_error ("Loop not vectorized. " - "Exiting as requested by Pragma SIMD"); + error_at (vect_location, "loop not vectorized. " + "Exiting as requested by Pragma SIMD"); return NULL; } /* Try the next biggest vector size. */