From patchwork Wed Feb 19 00:57:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iyer, Balaji V" X-Patchwork-Id: 321714 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 73B832C022C for ; Wed, 19 Feb 2014 11:57:38 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:content-type:mime-version; q=dns; s= default; b=xbA5yc9lNJMJ4JfWuwTRO56kDA7ObtkcCGV8P4vx1SRy/O6fU6nd/ ifyZAmZo8cT3Al/rVq0TtX1LbQkjotNuORzSJohghSabBichaDi2bP1JBdGLltDc NOpHBL0MgoDtgB67QX+1jd2AFk3hX1sDa3IvnlxNvXlW5gLx2UCG4A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:content-type:mime-version; s= default; bh=1gkTfHcPEqqbnKe1eMThU9huzGU=; b=ajBWKGNB/QE6MqcQXCFM YyaWCkwrYOqlOyC0i8lQ/L2VuT3986esg7onBhkjkPUOhVKgUK24jNHOrAyVyx6+ MSpZI5yYdulzSRoWxtMXECqyE1wvPnriNTLLGJyC6ZSnOuSYepWGkdn01hgrX6Nr ObbIAGhDs/w3diHZuGCC36k= Received: (qmail 12832 invoked by alias); 19 Feb 2014 00:57:31 -0000 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 Received: (qmail 12822 invoked by uid 89); 19 Feb 2014 00:57:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mga11.intel.com Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Feb 2014 00:57:29 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 18 Feb 2014 16:57:28 -0800 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34]) by fmsmga001.fm.intel.com with ESMTP; 18 Feb 2014 16:57:27 -0800 Received: from fmsmsx151.amr.corp.intel.com (10.19.17.220) by FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 18 Feb 2014 16:57:27 -0800 Received: from fmsmsx101.amr.corp.intel.com ([169.254.1.38]) by FMSMSX151.amr.corp.intel.com ([169.254.7.122]) with mapi id 14.03.0123.003; Tue, 18 Feb 2014 16:57:27 -0800 From: "Iyer, Balaji V" To: "gcc-patches@gcc.gnu.org" Subject: [PATCH][committed] two minor fixes in libcilkrts Date: Wed, 19 Feb 2014 00:57:27 +0000 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hello Everyone, This patch will fix two minor issues in libcilkrts. First being that we default to ABI 0 and secondly, fix an issue to initialize the stack frame correctly. All the changes are in libcilkrts and does not cause any regression failures. Thanks, Balaji V. Iyer. diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog index c340785..434b974 100644 --- a/libcilkrts/ChangeLog +++ b/libcilkrts/ChangeLog @@ -1,3 +1,10 @@ +2014-02-18 Balaji V. Iyer + + * include/cilk/common.h (__CILKRTS_ABI_VERSION): Set the ABI version + to 1 instead of 0. + * runtime/cilk-abi-cilk-for.cpp (cilk_for_recursive): Added a fix to + initialize stack frame correctly. + 2014-02-10 Balaji V. Iyer PR target/59691 diff --git a/libcilkrts/include/cilk/common.h b/libcilkrts/include/cilk/common.h index d2c84fa..97dd66e 100644 --- a/libcilkrts/include/cilk/common.h +++ b/libcilkrts/include/cilk/common.h @@ -317,13 +317,12 @@ namespace cilk { #ifndef __CILKRTS_ABI_VERSION # ifdef IN_CILK_RUNTIME # define __CILKRTS_ABI_VERSION 1 -# elif __INTEL_COMPILER > 1200 - // Intel compiler version >= 12.1 -# define __CILKRTS_ABI_VERSION 1 -# else - // Compiler does not support ABI version 1 - // (Non-Intel compiler or Intel compiler prior to version 12.1). +# elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER <= 1200) + // Intel compilers prior to version 12.1 support only ABI 0 # define __CILKRTS_ABI_VERSION 0 +# else + // Non-Intel compiler or Intel compiler after version 12.0. +# define __CILKRTS_ABI_VERSION 1 # endif #endif diff --git a/libcilkrts/runtime/cilk-abi-cilk-for.cpp b/libcilkrts/runtime/cilk-abi-cilk-for.cpp index 4fa6dce..4cd04f5 100644 --- a/libcilkrts/runtime/cilk-abi-cilk-for.cpp +++ b/libcilkrts/runtime/cilk-abi-cilk-for.cpp @@ -256,9 +256,19 @@ tail_recurse: // argument list of the spawned function, hence the call to // capture_spawn_arg_stack_frame(). __cilkrts_stack_frame *sf; +#if defined(__GNUC__) && ! defined(__INTEL_COMPILER) && ! defined(__clang__) + // The current version of gcc initializes the sf structure eagerly. + // We can take advantage of this fact to avoid calling + // `capture_spawn_arg_stack_frame` when compiling with gcc. + // Remove this if the "shrink-wrap" optimization is implemented. + sf = w->current_stack_frame; + _Cilk_spawn cilk_for_recursive(low, mid, body, data, grain, w, + loop_root_pedigree); +#else _Cilk_spawn cilk_for_recursive(low, mid, body, data, grain, capture_spawn_arg_stack_frame(sf, w), loop_root_pedigree); +#endif w = sf->worker; low = mid;