From patchwork Fri May 23 11:32:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 351813 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 6E46C140086 for ; Fri, 23 May 2014 21:33:46 +1000 (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:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=XIseWp1DbUGBBkYR Hee528OwQ115IeFrmC8bZtl/j3gyILqdft7U4M1PUJOGpbEaoiChcir8MqGh7qID 6JnFh2Drh3GSMBRiw/gTs0QKT7XXHuWEVoOvSoqsGNpif4A2+CswhA0lhWM4CeuK XkCiMvtYCuE5l5tXeNlmcHRaf6A= 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:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=LjsdxThHy6xHGfYSTGzU1U OeOXQ=; b=sbmS90NYl+eO8rnl28yACoWVP0qGJD+imjB3fWOulB5uQvN5ltiQGb xwtAYrIkHx3VgmLsEWf9zf0/KZxRRWbwc2VLg78+urZm6TQHmvigiehfh7sAPwmw 1NTXJ22TDRk48k3vfwujy5Xd4Lzd0v1/f6b4tUMeeW/3pR/ep0Oh0= Received: (qmail 5203 invoked by alias); 23 May 2014 11:33:39 -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 5188 invoked by uid 89); 23 May 2014 11:33:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 May 2014 11:33:37 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WnnjB-0000sv-M2 from Thomas_Schwinge@mentor.com ; Fri, 23 May 2014 04:33:33 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 23 May 2014 04:33:33 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Fri, 23 May 2014 12:33:32 +0100 From: Thomas Schwinge To: CC: Subject: [COMMITTED 2/2] GF_OMP_FOR_SIMD: Flag for SIMD variants of OMP_FOR kinds. Date: Fri, 23 May 2014 13:32:51 +0200 Message-ID: <1400844780-26290-2-git-send-email-thomas@codesourcery.com> In-Reply-To: <1400844780-26290-1-git-send-email-thomas@codesourcery.com> References: <20140320144512.GK1817@tucnak.redhat.com> <1400844780-26290-1-git-send-email-thomas@codesourcery.com> MIME-Version: 1.0 From: tschwinge gcc/ * gimple.h (enum gf_mask): Add and use GF_OMP_FOR_SIMD. * omp-low.c: Update accordingly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210855 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 3 +++ gcc/gimple.h | 6 ++++-- gcc/omp-low.c | 18 +++++++++--------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git gcc/ChangeLog gcc/ChangeLog index fa2f3c3..c1b2416 100644 --- gcc/ChangeLog +++ gcc/ChangeLog @@ -1,5 +1,8 @@ 2014-05-23 Thomas Schwinge + * gimple.h (enum gf_mask): Add and use GF_OMP_FOR_SIMD. + * omp-low.c: Update accordingly. + * gimple.h (enum gf_mask): Rewrite "<< 0" shift expressions used for GF_OMP_FOR_KIND_MASK, GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_DISTRIBUTE, GF_OMP_FOR_KIND_SIMD, diff --git gcc/gimple.h gcc/gimple.h index b1970e5..ceefbc0 100644 --- gcc/gimple.h +++ gcc/gimple.h @@ -94,8 +94,10 @@ enum gf_mask { GF_OMP_FOR_KIND_MASK = (1 << 2) - 1, GF_OMP_FOR_KIND_FOR = 0, GF_OMP_FOR_KIND_DISTRIBUTE = 1, - GF_OMP_FOR_KIND_SIMD = 2, - GF_OMP_FOR_KIND_CILKSIMD = 3, + /* Flag for SIMD variants of OMP_FOR kinds. */ + GF_OMP_FOR_SIMD = 1 << 1, + GF_OMP_FOR_KIND_SIMD = GF_OMP_FOR_SIMD | 0, + GF_OMP_FOR_KIND_CILKSIMD = GF_OMP_FOR_SIMD | 1, GF_OMP_FOR_COMBINED = 1 << 2, GF_OMP_FOR_COMBINED_INTO = 1 << 3, GF_OMP_TARGET_KIND_MASK = (1 << 2) - 1, diff --git gcc/omp-low.c gcc/omp-low.c index 95b0e52..54e837f 100644 --- gcc/omp-low.c +++ gcc/omp-low.c @@ -298,7 +298,7 @@ extract_omp_for_data (gimple for_stmt, struct omp_for_data *fd, int i; struct omp_for_data_loop dummy_loop; location_t loc = gimple_location (for_stmt); - bool simd = gimple_omp_for_kind (for_stmt) & GF_OMP_FOR_KIND_SIMD; + bool simd = gimple_omp_for_kind (for_stmt) & GF_OMP_FOR_SIMD; bool distribute = gimple_omp_for_kind (for_stmt) == GF_OMP_FOR_KIND_DISTRIBUTE; @@ -1020,7 +1020,7 @@ build_outer_var_ref (tree var, omp_context *ctx) x = build_receiver_ref (var, by_ref, ctx); } else if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR - && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_KIND_SIMD) + && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) { /* #pragma omp simd isn't a worksharing construct, and can reference even private vars in its linear etc. clauses. */ @@ -2249,7 +2249,7 @@ check_omp_nesting_restrictions (gimple stmt, omp_context *ctx) if (ctx != NULL) { if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR - && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_KIND_SIMD) + && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) { error_at (gimple_location (stmt), "OpenMP constructs may not be nested inside simd region"); @@ -2272,7 +2272,7 @@ check_omp_nesting_restrictions (gimple stmt, omp_context *ctx) switch (gimple_code (stmt)) { case GIMPLE_OMP_FOR: - if (gimple_omp_for_kind (stmt) & GF_OMP_FOR_KIND_SIMD) + if (gimple_omp_for_kind (stmt) & GF_OMP_FOR_SIMD) return true; if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_DISTRIBUTE) { @@ -2598,7 +2598,7 @@ scan_omp_1_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, if (setjmp_or_longjmp_p (fndecl) && ctx && gimple_code (ctx->stmt) == GIMPLE_OMP_FOR - && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_KIND_SIMD) + && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) { remove = true; error_at (gimple_location (stmt), @@ -3034,7 +3034,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, bool reduction_omp_orig_ref = false; int pass; bool is_simd = (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR - && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_KIND_SIMD); + && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD); int max_vf = 0; tree lane = NULL_TREE, idx = NULL_TREE; tree ivar = NULL_TREE, lvar = NULL_TREE; @@ -3774,7 +3774,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *stmt_list, } if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR - && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_KIND_SIMD) + && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) { simduid = find_omp_clause (orig_clauses, OMP_CLAUSE__SIMDUID_); if (simduid) @@ -3877,7 +3877,7 @@ lower_reduction_clauses (tree clauses, gimple_seq *stmt_seqp, omp_context *ctx) /* SIMD reductions are handled in lower_rec_input_clauses. */ if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR - && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_KIND_SIMD) + && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) return; /* First see if there is exactly one reduction clause. Use OMP_ATOMIC @@ -6925,7 +6925,7 @@ expand_omp_for (struct omp_region *region, gimple inner_stmt) original loops from being detected. Fix that up. */ loops_state_set (LOOPS_NEED_FIXUP); - if (gimple_omp_for_kind (fd.for_stmt) & GF_OMP_FOR_KIND_SIMD) + if (gimple_omp_for_kind (fd.for_stmt) & GF_OMP_FOR_SIMD) expand_omp_simd (region, &fd); else if (fd.sched_kind == OMP_CLAUSE_SCHEDULE_STATIC && !fd.have_ordered)