From patchwork Wed Jul 17 07:19:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1133147 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-505179-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="gHPDfAMG"; dkim-atps=neutral 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 45pTDD5nP0z9s8m for ; Wed, 17 Jul 2019 17:19:40 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=anCVRzyzkTXYjyQyzWBnQzrTn310g5pDSfgFeuHrmOg H3kt6AZ+SrLOwBrTeOeqmX8kNht4HObyvPxXvhQJ3rXk6422D5WHXWkA7nFWjijO 7wcZiIg+dBzCBb8iudca4VBzu0KdAHI9umG+57IcRzrY2Dkyye7mNR8XW/vANTA0 = 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:date :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=kXx7GUgmAOqK2D0rIiFHVRGXYS4=; b=gHPDfAMGxL4r5aaio YklTRE9e9781V0xdZdJRvm4KiUmi6ico+vMDbdUCJfljmbAvauqhBoEDYWKbPon3 otmloA7sqnnoVhJhfhtYWQEN8Vg0eqcsqlARfH8Jm1IZgbmySK3TgaiELPLWzHn/ Gjzj7IZT/FXzhwM4Shr4P9zj1I= Received: (qmail 16467 invoked by alias); 17 Jul 2019 07:19:33 -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 16458 invoked by uid 89); 17 Jul 2019 07:19:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=stood, UD:info X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Jul 2019 07:19:31 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E26A383F51 for ; Wed, 17 Jul 2019 07:19:29 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-236.ams2.redhat.com [10.36.116.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7FE935B684 for ; Wed, 17 Jul 2019 07:19:28 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x6H7JPDE007864 for ; Wed, 17 Jul 2019 09:19:25 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x6H7JOJ5007863 for gcc-patches@gcc.gnu.org; Wed, 17 Jul 2019 09:19:24 +0200 Date: Wed, 17 Jul 2019 09:19:24 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Small cleanup now that Cilk+ simd is not supported anymore Message-ID: <20190717071924.GB2125@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes Hi! We needed the & GF_OMP_FOR_SIMD stuff when we had GF_OMP_FOR_SIMD = 1 << 3, GF_OMP_FOR_KIND_SIMD = GF_OMP_FOR_SIMD | 0, GF_OMP_FOR_KIND_CILKSIMD = GF_OMP_FOR_SIMD | 1, and kind & GF_OMP_FOR_SIMD stood for kind == GF_OMP_FOR_KIND_SIMD || kind == GF_OMP_FOR_KIND_CILKSIMD Now that we don't have CILKSIMD (since GCC 8), that is completely unnecessary. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2019-07-17 Jakub Jelinek * gimple.h (enum gf_mask): Remove GF_OMP_FOR_SIMD, change GF_OMP_FOR_KIND_SIMD to a value serially after other kinds, divide GF_OMP_FOR_KIND_MASK, GF_OMP_FOR_COMBINED, GF_OMP_FOR_COMBINED_INTO, GF_OMP_FOR_GRID_PHONY, GF_OMP_FOR_GRID_INTRA_GROUP and GF_OMP_FOR_GRID_GROUP_ITER by two. * omp-grid.c (grid_process_grid_body, grid_eliminate_combined_simd_part): Use GF_OMP_FOR_KIND_SIMD instead of GF_OMP_FOR_SIMD, don't test & GF_OMP_FOR_SIMD but == GF_OMP_FOR_KIND_SIMD. * omp-low.c (build_outer_var_ref, scan_sharing_clauses, check_omp_nesting_restrictions, scan_omp_1_stmt, lower_rec_input_clauses, lower_lastprivate_conditional_clauses, lower_lastprivate_clauses, lower_reduction_clauses, lower_omp_scan, omp_find_scan): Likewise. * omp-expand.c (expand_omp_for): Likewise. * omp-general.c (omp_extract_for_data): Likewise. Jakub --- gcc/gimple.h.jj 2019-06-10 14:18:17.343527538 +0200 +++ gcc/gimple.h 2019-07-16 18:15:58.762506593 +0200 @@ -153,24 +153,22 @@ enum gf_mask { GF_OMP_PARALLEL_GRID_PHONY = 1 << 1, GF_OMP_TASK_TASKLOOP = 1 << 0, GF_OMP_TASK_TASKWAIT = 1 << 1, - GF_OMP_FOR_KIND_MASK = (1 << 4) - 1, + GF_OMP_FOR_KIND_MASK = (1 << 3) - 1, GF_OMP_FOR_KIND_FOR = 0, GF_OMP_FOR_KIND_DISTRIBUTE = 1, GF_OMP_FOR_KIND_TASKLOOP = 2, GF_OMP_FOR_KIND_OACC_LOOP = 4, - GF_OMP_FOR_KIND_GRID_LOOP = 5, - /* Flag for SIMD variants of OMP_FOR kinds. */ - GF_OMP_FOR_SIMD = 1 << 3, - GF_OMP_FOR_KIND_SIMD = GF_OMP_FOR_SIMD | 0, - GF_OMP_FOR_COMBINED = 1 << 4, - GF_OMP_FOR_COMBINED_INTO = 1 << 5, + GF_OMP_FOR_KIND_GRID_LOOP = 5, + GF_OMP_FOR_KIND_SIMD = 6, + GF_OMP_FOR_COMBINED = 1 << 3, + GF_OMP_FOR_COMBINED_INTO = 1 << 4, /* The following flag must not be used on GF_OMP_FOR_KIND_GRID_LOOP loop statements. */ - GF_OMP_FOR_GRID_PHONY = 1 << 6, + GF_OMP_FOR_GRID_PHONY = 1 << 5, /* The following two flags should only be set on GF_OMP_FOR_KIND_GRID_LOOP loop statements. */ - GF_OMP_FOR_GRID_INTRA_GROUP = 1 << 6, - GF_OMP_FOR_GRID_GROUP_ITER = 1 << 7, + GF_OMP_FOR_GRID_INTRA_GROUP = 1 << 5, + GF_OMP_FOR_GRID_GROUP_ITER = 1 << 6, GF_OMP_TARGET_KIND_MASK = (1 << 4) - 1, GF_OMP_TARGET_KIND_REGION = 0, GF_OMP_TARGET_KIND_DATA = 1, --- gcc/omp-grid.c.jj 2019-07-10 15:52:27.858038889 +0200 +++ gcc/omp-grid.c 2019-07-16 18:19:33.239240023 +0200 @@ -1002,7 +1002,7 @@ grid_process_grid_body (gimple_stmt_iter *handled_ops_p = false; gimple *stmt = gsi_stmt (*gsi); if (gimple_code (stmt) == GIMPLE_OMP_FOR - && (gimple_omp_for_kind (stmt) & GF_OMP_FOR_SIMD)) + && gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_SIMD) { gomp_for *loop = as_a (stmt); tree clauses = gimple_omp_for_clauses (loop); @@ -1030,14 +1030,14 @@ grid_eliminate_combined_simd_part (gomp_ memset (&wi, 0, sizeof (wi)); wi.val_only = true; - enum gf_mask msk = GF_OMP_FOR_SIMD; + enum gf_mask msk = GF_OMP_FOR_KIND_SIMD; wi.info = (void *) &msk; walk_gimple_seq (gimple_omp_body (parloop), omp_find_combined_for, NULL, &wi); gimple *stmt = (gimple *) wi.info; /* We expect that the SIMD id the only statement in the parallel loop. */ gcc_assert (stmt && gimple_code (stmt) == GIMPLE_OMP_FOR - && (gimple_omp_for_kind (stmt) == GF_OMP_FOR_SIMD) + && (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_SIMD) && gimple_omp_for_combined_into_p (stmt) && !gimple_omp_for_combined_p (stmt)); gomp_for *simd = as_a (stmt); --- gcc/omp-low.c.jj 2019-07-16 18:14:17.965041785 +0200 +++ gcc/omp-low.c 2019-07-16 18:41:21.660310215 +0200 @@ -580,7 +580,7 @@ build_outer_var_ref (tree var, omp_conte 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_SIMD) + && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD) || (code == OMP_CLAUSE_PRIVATE && (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR || gimple_code (ctx->stmt) == GIMPLE_OMP_SECTIONS @@ -1441,7 +1441,7 @@ scan_sharing_clauses (tree clauses, omp_ install_var_local (decl, ctx); } else if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR - && (gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) + && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD && !OMP_CLAUSE__CONDTEMP__ITER (c)) install_var_local (decl, ctx); break; @@ -2750,7 +2750,7 @@ check_omp_nesting_restrictions (gimple * switch (gimple_code (stmt)) { case GIMPLE_OMP_FOR: - if (gimple_omp_for_kind (stmt) & GF_OMP_FOR_SIMD) + if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_SIMD) return true; if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_DISTRIBUTE) { @@ -3496,7 +3496,7 @@ scan_omp_1_stmt (gimple_stmt_iterator *g { if (ctx && gimple_code (ctx->stmt) == GIMPLE_OMP_FOR - && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_SIMD + && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD && setjmp_or_longjmp_p (fndecl)) { remove = true; @@ -4118,7 +4118,7 @@ lower_rec_input_clauses (tree clauses, g 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_SIMD); + && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD); omplow_simd_context sctx = omplow_simd_context (); tree simt_lane = NULL_TREE, simtrec = NULL_TREE; tree ivar = NULL_TREE, lvar = NULL_TREE, uid = NULL_TREE; @@ -6093,7 +6093,7 @@ lower_lastprivate_conditional_clauses (t tree cond_ptr = NULL_TREE; tree iter_var = NULL_TREE; bool is_simd = (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR - && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD); + && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD); tree next = *clauses; for (tree c = *clauses; c; c = OMP_CLAUSE_CHAIN (c)) if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE @@ -6225,7 +6225,7 @@ lower_lastprivate_clauses (tree clauses, bool maybe_simt = false; if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR - && gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) + && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD) { maybe_simt = omp_find_clause (orig_clauses, OMP_CLAUSE__SIMT_); simduid = omp_find_clause (orig_clauses, OMP_CLAUSE__SIMDUID_); @@ -6707,7 +6707,7 @@ lower_reduction_clauses (tree clauses, g /* 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_SIMD) + && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD) return; /* inscan reductions are handled elsewhere. */ @@ -8923,7 +8923,7 @@ lower_omp_scan (gimple_stmt_iterator *gs bool input_phase = has_clauses ^ octx->scan_inclusive; bool is_simd = (gimple_code (octx->stmt) == GIMPLE_OMP_FOR - && (gimple_omp_for_kind (octx->stmt) & GF_OMP_FOR_SIMD)); + && gimple_omp_for_kind (octx->stmt) == GF_OMP_FOR_KIND_SIMD); bool is_for = (gimple_code (octx->stmt) == GIMPLE_OMP_FOR && gimple_omp_for_kind (octx->stmt) == GF_OMP_FOR_KIND_FOR && !gimple_omp_for_combined_p (octx->stmt)); @@ -9409,7 +9409,7 @@ omp_find_scan (gimple_stmt_iterator *gsi WALK_SUBSTMTS; case GIMPLE_OMP_FOR: - if ((gimple_omp_for_kind (stmt) & GF_OMP_FOR_SIMD) + if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_SIMD && gimple_omp_for_combined_into_p (stmt)) *handled_ops_p = false; break; --- gcc/omp-expand.c.jj 2019-07-10 15:52:32.293969796 +0200 +++ gcc/omp-expand.c 2019-07-16 18:16:26.710080940 +0200 @@ -6532,7 +6532,7 @@ expand_omp_for (struct omp_region *regio 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_SIMD) + if (gimple_omp_for_kind (fd.for_stmt) == GF_OMP_FOR_KIND_SIMD) expand_omp_simd (region, &fd); else if (gimple_omp_for_kind (fd.for_stmt) == GF_OMP_FOR_KIND_OACC_LOOP) { --- gcc/omp-general.c.jj 2019-07-03 07:02:16.457989933 +0200 +++ gcc/omp-general.c 2019-07-16 18:16:47.562763347 +0200 @@ -156,7 +156,7 @@ omp_extract_for_data (gomp_for *for_stmt 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_SIMD; + bool simd = gimple_omp_for_kind (for_stmt) == GF_OMP_FOR_KIND_SIMD; bool distribute = gimple_omp_for_kind (for_stmt) == GF_OMP_FOR_KIND_DISTRIBUTE; bool taskloop = gimple_omp_for_kind (for_stmt)