From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75890 invoked by alias); 11 Apr 2018 08:59:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 75872 invoked by uid 89); 11 Apr 2018 08:59:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=axis, filed 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 08:59:20 +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 1f6Bb4-0002ra-Od from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Wed, 11 Apr 2018 01:59:18 -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 09:59:15 +0100 Subject: Re: [nvptx] propagating conditionals in worker-vector partitioned loops To: Cesar Philippidis References: <2d3d57d2-e5a8-04e9-7ad1-72e4b21beae4@codesourcery.com> CC: "gcc-patches@gcc.gnu.org" From: Tom de Vries Message-ID: Date: Wed, 11 Apr 2018 08:59:00 -0000 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: <2d3d57d2-e5a8-04e9-7ad1-72e4b21beae4@codesourcery.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit 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) X-SW-Source: 2018-04/txt/msg00511.txt.bz2 On 10/27/2016 12:29 AM, Cesar Philippidis wrote: > Currently, the nvptx backend is only neutering the worker axis when > propagating variables used in conditional expressions across the worker > and vector axes. That's a problem with the worker-state spill and fill > propagation implementation because all of the vector threads in worker 0 > all write the the same address location being spilled. As the attached > test case demonstrates, this might cause an infinite loop depending on > the values in the vector threads being propagated. > > This patch fixes this issue by introducing a new worker-vector > predicate, so that both the worker and vector threads can be predicated > together, not separately. I.e., instead of first neutering worker axis, > then neutering the vector axis, this patch uses a single predicate for > tid.x == 0 && tid.y == 0. > > Is this patch ok for trunk? Hi Cesar, Please, when encountering a bug on trunk or release branch always file a PR. I accidentally found this bug recently, filed it as PR85204 - "[nvptx] infinite loop generated", and then fixed it here: https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00232.html . The patch you propose is not correct because it introduces a diverging branch marked with .uni. Thanks, - Tom