Message ID | Zc819iVeHfLDZb5y@tucnak |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp415188dyb; Fri, 16 Feb 2024 02:17:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW3HmtL8eR72r56doi9DLx8p0gG6MnS0jrwPTyJv+JY3Zxth/a/HpeAggYZ4bBcu0qsVe7/wT4I5gXKQy/7fVCDEf/Ddg== X-Google-Smtp-Source: AGHT+IG3t3zrrIGbleUuMN0NTaxsCNiecrqdCVsdO8xyVN4+AlRjEJp9VFXeSpNYcGXeZsiaxcKL X-Received: by 2002:a1f:4b44:0:b0:4c0:24e6:f49d with SMTP id y65-20020a1f4b44000000b004c024e6f49dmr3942377vka.1.1708078638032; Fri, 16 Feb 2024 02:17:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708078638; cv=pass; d=google.com; s=arc-20160816; b=m9H+hzE9Ui1DSJvO1hA5fRyIAsLgQuiJhlHRbh3cOlOkFLlgOvVfeUKvyFUNGT5StF tmzLY78ddg9Ft7X7qgGq9PsstbGNQBXHOZp+/+Zfiq4Zfju2tD2mPZGdntR12QUt6S9Y ARalfJxNhdVUb7S+ZcLRlOFuKKKjR44dx8TtFxY+pQu5rTi7gxaAbDo2Hbf67ZQWZ73y mZs4nchtTuN9FTDRCvrL6qQc537slHREPfLMA6pUfddZwJJ0imAJaIHkPhkzN5ido0bU ecPRT9Nyhlqpxrks5wjnjzajw4QQvhYabiwi4hSSOU1vWy+GZpJ6ydk6lCkvd+YP3nnD y/Hg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=ONu180l47j5sD+TjZjPALcdRQ7AuDvxlu4RLDkl618Y=; fh=UQf3Qy6ZULWe4sISgEploBBttjsWVuYBxKJi65afdVk=; b=NSH9LjcQGBYFZwSbhS0tDkoBE1SMfgjEwSDFzZo356OAKG5nG+Ab6c4XhyU0jhnLOl pabdtq2rR6eFjb8YYhn2AM28tdc8Wz7eF9PT5fKCha4O2w0XJ4ot/IuM9vztlZ+US0lT vObxsJBqoShVbyY9gJSmqm1Imuq1ihxifhFaa11PYu4uPRfbqh1hLQE16OUZBg/pbF/0 TDdhzss97BbboTMcgzcqwT46/2GoyfbPLEq1O3aipkLRqLAJ/HyTLa8MqL7DRKvO0nVn tMLSAdOjpFprKR93/X0zbSDApOzBdxOeilOnqDZkrV7aLn9tOTiuawj7uLqreWJPc4Tp lvfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Uc1VekDG; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id t2-20020ad45bc2000000b0068ed2a8ed18si3710494qvt.352.2024.02.16.02.17.17 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 02:17:18 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Uc1VekDG; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B050A38582B0 for <ouuuleilei@gmail.com>; Fri, 16 Feb 2024 10:17:17 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8A6ED3858C54 for <gcc-patches@gcc.gnu.org>; Fri, 16 Feb 2024 10:16:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A6ED3858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8A6ED3858C54 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708078594; cv=none; b=au18gAa06eD4Cbo5jHDch2rgH2imzr6KA4tfT8U+yWg/462PPyvejGw/ETwftVVq8n7ih8zbgkm0CV/HdOmhTBzgqTIdBMuS9JmBfkVxuTa0k0xMOMv3nVPdKPN+N2IMX/YyaBsC0nM5hQq3ASAEpO/QNynA6CA9rQR6MijKYNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708078594; c=relaxed/simple; bh=v502wD5IO0Ctw5++8hh4Ej3tTGb9pS+ZlML4ICbbysQ=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=kKRgeO7XKBHBPWXa/cBda3bs1e2tpws5Q+9ChaE89RDXVGe7kzFw2o7kETxiOCtDYu3vSZWLbVYaGrqTf8UzkNKHQ8kdHVL8rOaOW4JVDnCJTKA/gj7xPO6Ad4Z/QvNq1tau5JmnVEtZ/0xTFZHOgHYnX9GgukNZGK4i4Z+tFF0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708078592; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=ONu180l47j5sD+TjZjPALcdRQ7AuDvxlu4RLDkl618Y=; b=Uc1VekDGomEuLDwUeSkX0oz7eVYh80icJ76B/2/QLu9/PXW3rSCriMoTp4Ij1fCVW4mYej vr2DU/Q05G+9PHPMhX1eOX9Msl4j12HP/DEMxIuckEUGXE8wfc25KzfxKNY2jTOS3wMLjE YfPlxYIHS6iDo8baHJF5UibgDfhhSQ4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-y8AFGawDNtqmIUntNgwTGA-1; Fri, 16 Feb 2024 05:16:29 -0500 X-MC-Unique: y8AFGawDNtqmIUntNgwTGA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 64CD51C0650A; Fri, 16 Feb 2024 10:16:29 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CCA12166B4F; Fri, 16 Feb 2024 10:16:28 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 41GAGPLq4076446 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 16 Feb 2024 11:16:26 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 41GAGNjd4076445; Fri, 16 Feb 2024 11:16:23 +0100 Date: Fri, 16 Feb 2024 11:16:22 +0100 From: Jakub Jelinek <jakub@redhat.com> To: Richard Biener <rguenther@suse.de>, Rainer Orth <ro@cebitec.uni-bielefeld.de>, Mike Stump <mikestump@comcast.net>, Thomas Schwinge <tschwinge@baylibre.com> Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] testsuite: Fix up lra effective target Message-ID: <Zc819iVeHfLDZb5y@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: Jakub Jelinek <jakub@redhat.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791050265622430017 X-GMAIL-MSGID: 1791050265622430017 |
Series |
testsuite: Fix up lra effective target
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jakub Jelinek
Feb. 16, 2024, 10:16 a.m. UTC
Hi! Given the recent discussions on IRC started with Andrew P. mentioning that an asm goto outputs test should have { target lra } and the lra effective target in GCC 11/12 only returning 0 for PA and in 13/14 for PA/AVR, while we clearly have 14 other targets which don't support LRA and a couple of further ones which have an -mlra/-mno-lra switch (whatever default they have), seems to me the effective target is quite broken. The following patch rewrites it, such that it has a fast path for heavily used targets which are for years known to use only LRA (just an optimization) plus determines whether it is a LRA target or reload target by scanning the -fdump-rtl-reload-details dump on an empty function, LRA has quite a few always emitted messages in that case while reload has none of those. Tested on x86_64-linux and cross to s390x-linux, for the latter with both make check-gcc RUNTESTFLAGS='--target_board=unix/-mno-lra dg.exp=pr107385.c' where the test is now UNSUPPORTED and make check-gcc RUNTESTFLAGS='--target_board=unix/-mlra dg.exp=pr107385.c' where it fails because I don't have libc around. Ok for trunk? There is one special case, NVPTX, which is a TARGET_NO_REGISTER_ALLOCATION target. I think claiming for it that it is a lra target is strange (even though it effectively returns true for targetm.lra_p ()), unsure if it supports asm goto with outputs or not, if it does and we want to test it, perhaps we should introduce asm_goto_outputs effective target and use lra || nvptx-*-* for that? 2024-02-16 Jakub Jelinek <jakub@redhat.com> * lib/target-supports.exp (check_effective_target_lra): Rewrite to list some heavily used always LRA targets and otherwise check the -fdump-rtl-reload-details dump for messages specific to LRA. Jakub
Comments
On Feb 16, 2024, at 2:16 AM, Jakub Jelinek <jakub@redhat.com> wrote: > > Given the recent discussions on IRC started with Andrew P. mentioning that > an asm goto outputs test should have { target lra } and the lra effective > target in GCC 11/12 only returning 0 for PA and in 13/14 for PA/AVR, while > we clearly have 14 other targets which don't support LRA and a couple of > further ones which have an -mlra/-mno-lra switch (whatever default they > have), seems to me the effective target is quite broken. > > Ok for trunk? Ok.
On Feb 16, 2024, at 2:16 AM, Jakub Jelinek <jakub@redhat.com> wrote: > > There is one special case, NVPTX, which is a TARGET_NO_REGISTER_ALLOCATION > target. I think claiming for it that it is a lra target is strange (even > though it effectively returns true for targetm.lra_p ()), unsure if it > supports asm goto with outputs or not, if it does and we want to test it, > perhaps we should introduce asm_goto_outputs effective target and use > lra || nvptx-*-* for that? Since the port people have to maintain that code in general, I usually leave it to them to try and select a cheap, maintainable way to manage it. If people want to pave the way, I'd tend to defer to them, having thought about more than I.
> Date: Fri, 16 Feb 2024 11:16:22 +0100 > From: Jakub Jelinek <jakub@redhat.com> > Given the recent discussions on IRC started with Andrew P. mentioning that > an asm goto outputs test should have { target lra } and the lra effective > target in GCC 11/12 only returning 0 for PA and in 13/14 for PA/AVR, while > we clearly have 14 other targets which don't support LRA and a couple of > further ones which have an -mlra/-mno-lra switch (whatever default they > have), seems to me the effective target is quite broken. Definitely, good riddance to that list. I suggested a little over a year ago to generalize check_effective_target_lra to get rid of that flawed target list but was effectively shut down with a review request that'd *keep* the faulty non-lra target list. :-( "https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611531.html" TL;DR: I based LRA-ness on EBB being scanned in LRA but not for reload (same empty foo), i.e. matching the string "EBB 2 3". I don't know which method more stable, but that didn't require -O2 nor -fdump-rtl-reload-details. Having said that, I'm glad there's now a generic, working (non-target-list-dependent) effective_target lra. brgds, H-P
--- gcc/testsuite/lib/target-supports.exp.jj 2024-02-15 09:51:34.591064180 +0100 +++ gcc/testsuite/lib/target-supports.exp 2024-02-16 10:50:29.986180603 +0100 @@ -13215,10 +13215,17 @@ proc check_effective_target_powerpc_as_p # return 1 if LRA is supported. proc check_effective_target_lra { } { - if { [istarget hppa*-*-*] || [istarget avr-*-*] } { - return 0 + # Start with heavily used targets which are known to always use LRA. + if { [istarget i?86-*-*] || [istarget x86_64-*-*] + || [istarget aarch64*-*-*] || [istarget arm*-*-*] + || [istarget powerpc*-*-*] || [istarget riscv*-*-*] } { + return 1 } - return 1 + + # Otherwise check the reload dump for messages emitted solely by LRA. + return [check_no_messages_and_pattern lra "\\\*{9} Local #1: \\\*{9}" rtl-reload { + void foo (void) {} + } {-O2 -fdump-rtl-reload-details}] ;# LRA notes requires a detailed dump. } # Test whether optimizations are enabled ('__OPTIMIZE__') per the