From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id C8772382EA34 for ; Thu, 27 Oct 2022 02:27:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C8772382EA34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.95,215,1661846400"; d="scan'208";a="85331999" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 26 Oct 2022 18:27:23 -0800 IronPort-SDR: fhPe4uy2yMctpKgD3zWPR0MMzZ9VjcE4Qy0ZQHt3AoDnugmDs+0ElJ5wpptYQcmRu94axvs+LM WXFP03V4KLYvx596AP3oW4X3p10PuLXClH9QHo7PT0HLvHixxxl1trTUzcXtLmbfuFsvzM4IZf P+eK5RAbvhsb1jZNl28JBYT9keTBFHdYI4BoXQbCOgnYV+AaK+M8/oSN9jOIE8mxB0EVT3c8Ng uv2lEys7uqTT5tI410Ga+d3vrsPmsq0eDy7SbmYEaYiv9RWJddIAXPr0Ls/vKkdUwI4cLOdyQF RAM= Message-ID: Date: Wed, 26 Oct 2022 20:27:19 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v3] Re: OpenMP: Generate SIMD clones for functions with "declare target" Content-Language: en-US To: Jakub Jelinek CC: Jan Hubicka , "gcc-patches@gcc.gnu.org" , Thomas Schwinge References: <0b64e323-63f9-e4b7-eb7f-83f3b5e3125b@codesourcery.com> <001679b1-814a-c1db-5611-c663f6931d11@codesourcery.com> From: Sandra Loosemore In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-14.mgc.mentorg.com (147.34.90.214) To svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10/20/22 08:07, Jakub Jelinek wrote: > Thus, IMHO it is exactly the pass_omp_simd_clone pass where you want to > implement this auto-simdization discovery, guarded with > #ifdef ACCEL_COMPILER and the new option (which means it will be done > only for gcn and not on the host right now). I'm running into a practical difficulty with making this controlled by a static #ifdef: namely, testing. One of my test cases examines the .s output to make sure that the clones are emitted as local symbols and not global. I have not been able to find the symbol linkage information in any of the dump files, and I have also not been able to figure out how to get a .s file from the offload compiler even outside of the DejaGnu test harness. (It's possible I am just an extreme dummy about the latter problem, but so far none of my colleagues here has been able to give me a recipe either.) On top of that, I worry that this should be tested more broadly than for the one target we're presently focusing on (AMD GCN), and we'll get much more regular test coverage if it's also enabled for x86_64 target which has the necessary compute_vecsize_and_simdlen target hook. I remember Carlos O'Donnell used to have a favorite mantra, "design for test". So, maybe generalize the new -fopenmp-target-simd-clone option to take a parameter to force clones to be generated on the OpenMP host for test purposes? The "declare target" directive already has a clause device_type(host|nohost|any) that defaults to "any"; maybe we could use that syntax like -fopenmp-target-simd-clone=any and use the intersection of the two sets to determine what to auto-generate clones for? -Sandra