From patchwork Wed Apr 11 10:33:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 897130 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-476197-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="wjmPvH0K"; 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 40LgPg1BKxz9s35 for ; Wed, 11 Apr 2018 20:33:58 +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 :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=hBpa5CgxyvnTefZcf /jz97lBEvKNcVd+wh/tRDOnjSeT7ovLuY73su6IIeOa1U6uT/ZIE1ONP0d7PJiMI tDsToxatlvPhHWuEu47YayGhSs92T/UVJlLInoslYRQEu4WQOpF4hPWpo0cUr6hi X3VRnbZz+Rln7OT0wdrESTGKdc= 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 :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=Oam1Ptzbdf345QDNrna9ROK Rc08=; b=wjmPvH0KwVDsNrpFhZEAgx9NYtPMzrIr4Y8wuUJ7gIg10TQdLqJ+SpY aQVNMDykiOpmZLdG+M9KyXXWNE9UjOtENVkbx/0eIWMgP9wMONeuIz6mnMeuUElA n50pNSpfu7NtRFjXoRUAriW7ETcFxeYvDWRQkdhZxSDw4zok4Ht8= Received: (qmail 35382 invoked by alias); 11 Apr 2018 10:33:52 -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 35367 invoked by uid 89); 11 Apr 2018 10:33:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=201610 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; Wed, 11 Apr 2018 10:33:50 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1f6D4W-0005Ak-4M from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Wed, 11 Apr 2018 03:33:48 -0700 Received: from [137.202.13.181] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 11 Apr 2018 11:33:43 +0100 Subject: [og7] Backport "[nvptx] Fix neutering of bb with only cond jump" To: Cesar Philippidis , "gcc-patches@gcc.gnu.org" References: From: Tom de Vries Message-ID: <0bf4adda-1114-6598-12bf-5d7f81585947@mentor.com> Date: Wed, 11 Apr 2018 12:33:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) [ was: Re: [gomp4] propagating conditionals in worker-vector partitioned loops ] On 10/28/2016 06:33 PM, Cesar Philippidis wrote: > I've applied the patch to gomp-4_0-branch to correct an issue involving > the propagation of variables used in conditional expressions to worker > and vector partitioned loops. More details regarding this patch can be > found here I've reverted this patch on og7, and backported the fix for PR85204. Thanks, - Tom Backport "[nvptx] Fix neutering of bb with only cond jump" 2018-04-11 Tom de Vries backport from trunk: 2018-04-05 Tom de Vries PR target/85204 * config/nvptx/nvptx.c (nvptx_single): Fix neutering of bb with only cond jump. revert: 2016-10-28 Cesar Philippidis * config/nvptx/nvptx.c (nvptx_single): Use a single predicate for loops partitioned across both worker and vector axes. --- gcc/config/nvptx/nvptx.c | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index cd89d17..3c48c14 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -4196,38 +4196,12 @@ nvptx_single (unsigned mask, basic_block from, basic_block to) /* Insert the vector test inside the worker test. */ unsigned mode; rtx_insn *before = tail; - rtx wvpred = NULL_RTX; - bool skip_vector = false; - - /* Create a single predicate for loops containing both worker and - vectors. */ - if (cond_branch - && (GOMP_DIM_MASK (GOMP_DIM_WORKER) & mask) - && (GOMP_DIM_MASK (GOMP_DIM_VECTOR) & mask)) - { - rtx regx = gen_reg_rtx (SImode); - rtx regy = gen_reg_rtx (SImode); - rtx tmp = gen_reg_rtx (SImode); - wvpred = gen_reg_rtx (BImode); - - emit_insn_before (gen_oacc_dim_pos (regx, const1_rtx), head); - emit_insn_before (gen_oacc_dim_pos (regy, const2_rtx), head); - emit_insn_before (gen_rtx_SET (tmp, gen_rtx_IOR (SImode, regx, regy)), - head); - emit_insn_before (gen_rtx_SET (wvpred, gen_rtx_NE (BImode, tmp, - const0_rtx)), - head); - - skip_mask &= ~(GOMP_DIM_MASK (GOMP_DIM_VECTOR)); - skip_vector = true; - } - + rtx_insn *neuter_start = NULL; for (mode = GOMP_DIM_WORKER; mode <= GOMP_DIM_VECTOR; mode++) if (GOMP_DIM_MASK (mode) & skip_mask) { rtx_code_label *label = gen_label_rtx (); - rtx pred = skip_vector ? wvpred - : cfun->machine->axis_predicate[mode - GOMP_DIM_WORKER]; + rtx pred = cfun->machine->axis_predicate[mode - GOMP_DIM_WORKER]; if (!pred) { @@ -4240,7 +4214,10 @@ nvptx_single (unsigned mask, basic_block from, basic_block to) br = gen_br_true (pred, label); else br = gen_br_true_uni (pred, label); - emit_insn_before (br, head); + if (neuter_start) + neuter_start = emit_insn_after (br, neuter_start); + else + neuter_start = emit_insn_before (br, head); LABEL_NUSES (label)++; if (tail_branch)