From patchwork Fri Apr 19 10:39:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 88723 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 811423849AF4 for ; Fri, 19 Apr 2024 10:40:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 423BF3845BC1 for ; Fri, 19 Apr 2024 10:39:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 423BF3845BC1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 423BF3845BC1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::633 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713523184; cv=none; b=U+LmjRdX2E30DWMKRGPRh7DdrPxXGIDUekNkL/6RceyC3u2yYyapXvlFF/rL4V7hfstwZv61v9h62Ura10MROaA2/TD20bTe96pz1+O9r192vqxTA0UAPUZYteeIy/g0jiY22eArVcUJuRR8Xgb7zFSh3t3nwiaMdCdJJvK+9E8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713523184; c=relaxed/simple; bh=yWzM5pp8aZXHXND8BMDV4t5D5585JLpAWdQLtZRluiI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dahd2fP/VWruWQx7ku7V4H4awxHrnQWD/1XfzcawGCTNBqcT/s3krIfUVK+1f+XR4FLWremtN9RLg+/6L7bOzeXANDYhNUBDxBMGhaz9Gek4v5cr6OKm27AAH74CWHSVOJK3DV4vVEkqHcnPq/4E1aoKSemPXs8TuJJpeDe6q20= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a554afec54eso197402566b.1 for ; Fri, 19 Apr 2024 03:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1713523180; x=1714127980; darn=gcc.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=hlKkWc0wUnHcyY+ysM0BAx/ahyapZOFhmnaMD5afb+E=; b=azdm83oKMRP4qWF14j+Ay0jnJRwa/qoNBBC7MTchcuKcKpCRyAb9YF081OY1N5zEsx mrNSQDJOxcrbiKE/u1DXcPWfpe3juxXcSArFWq3Rhz58QZP+RyBxV/YxBRtVJyps0SJn 270fvMcL8S2E8Au3DZ3HDs+BGD/enoNcbFTEV7cRV0Z1IROvEvsaRb3ug9nuRd43xC55 Gj7t1zVYhiZZTA6HjciV4NACVaZTCNg/Izn3G3lmfmdTeL+uMkOe18AlIzpJILd8zx0Y NgWBczyspkyZv+oebS5Ra0EC9TYsnsKBGuhXnKQee/cRyh99LL+k7LIrdz6cPPK16ptf Kq1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713523180; x=1714127980; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hlKkWc0wUnHcyY+ysM0BAx/ahyapZOFhmnaMD5afb+E=; b=kWtZiSdNaBXlkvBmIbNsvOm08AQBTtl8OZXkfHGczIkuYsiDHDa/nU0c3wefHyK3V+ Ah5ei4A87vXws2iB/mNHICFj1BQn9U89x32zgFdvA+cCsyXksntTPPmo/PKXdzyW23/k 99Z1064DbNJWe2XBbEPycRqTOUI0ieB0VNQG+e+WmjTjKv6eLIz2I+XL+z110Q2wRL8C QgCNTw9sGoYDoZFjUFLyX36cTeSKJuIua3y0xTevjfMKANDvF/xSb350Dr09lNIqyXbY 7iOfuXhPrra9Lu2kLugSMEemki/71AAoZxVHrjYiuC4NBc7WJ56rNyufJ1Jy0c9JB0MM QK+Q== X-Forwarded-Encrypted: i=1; AJvYcCU9aW2rBp3aUoHim0TufF3K5cVf0d8EQEoe9Q2EZSEFdZiKzalufgMYLvEQgcVS8y0b1cLXv4aaR4Xw8urQwAq+0rXipFOz7Q== X-Gm-Message-State: AOJu0Yz/tUdntFymlHlQoRtJLo6e6tmws7OwEJhA/a6J6kQ1aoBetCaO lCa5eYasl/0dYjXmTywlK+EvoBAT0aHiYHWcu37bELdlKANq2TGHbrzH/Dcj54x4OnudR8rbWln AKVI= X-Google-Smtp-Source: AGHT+IEIzar7pqdH0vhPodovFvgi+o1rp/aXWi5UvE1miZi7WdCkOrZ1tit6qV6/cytCd7s3H90Vqw== X-Received: by 2002:a17:906:b117:b0:a52:671a:aaf2 with SMTP id u23-20020a170906b11700b00a52671aaaf2mr1162500ejy.72.1713523179632; Fri, 19 Apr 2024 03:39:39 -0700 (PDT) Received: from euler.schwinge.homeip.net (p200300c8b713f800f1860ca6b7da3140.dip0.t-ipconnect.de. [2003:c8:b713:f800:f186:ca6:b7da:3140]) by smtp.gmail.com with ESMTPSA id am20-20020a170906569400b00a52228ce058sm2046558ejc.46.2024.04.19.03.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 03:39:39 -0700 (PDT) From: Thomas Schwinge To: Jakub Jelinek , gcc-patches@gcc.gnu.org Cc: Richard Biener , Jeff Law , Eric Botcazou , Tom de Vries Subject: Enable 'gcc.dg/pr114768.c' for nvptx target [PR114768] (was: [PATCH] rtlanal: Fix set_noop_p for volatile loads or stores [PR114768]) In-Reply-To: References: <87wmot3b3s.fsf@euler.schwinge.ddns.net> User-Agent: Notmuch/0.30+8~g47a4bad (https://notmuchmail.org) Emacs/29.2 (x86_64-pc-linux-gnu) Date: Fri, 19 Apr 2024 12:39:37 +0200 Message-ID: <87edb1iql2.fsf@euler.schwinge.ddns.net> MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Hi! On 2024-04-19T12:30:25+0200, Jakub Jelinek wrote: > On Fri, Apr 19, 2024 at 12:23:03PM +0200, Thomas Schwinge wrote: >> On 2024-04-19T08:24:03+0200, Jakub Jelinek wrote: >> > --- gcc/testsuite/gcc.dg/pr114768.c.jj 2024-04-18 15:37:49.139433678 +0200 >> > +++ gcc/testsuite/gcc.dg/pr114768.c 2024-04-18 15:43:30.389730365 +0200 >> > @@ -0,0 +1,10 @@ >> > +/* PR rtl-optimization/114768 */ >> > +/* { dg-do compile } */ >> > +/* { dg-options "-O2 -fdump-rtl-final" } */ >> > +/* { dg-final { scan-rtl-dump "\\\(mem/v:" "final" { target { ! { nvptx*-*-* } } } } } */ >> > + >> > +void >> > +foo (int *p) >> > +{ >> > + *p = *(volatile int *) p; >> > +} >> >> Why exclude nvptx target here? As far as I can see, it does behave in >> the exactly same way as expected; see 'diff' of before vs. after the >> 'gcc/rtlanal.cc' code changes: > > I wasn't sure if the non-RA targets (for which we don't have an effective > target) even have final dump. > If they do as you show, then guess the target guard can go. ACK. Pushed to trunk branch in commit 9451b6c0a941dc44ca6f14ff8565d74fe56cca59 "Enable 'gcc.dg/pr114768.c' for nvptx target [PR114768]", see attached. Grüße Thomas From 9451b6c0a941dc44ca6f14ff8565d74fe56cca59 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 19 Apr 2024 12:32:03 +0200 Subject: [PATCH] Enable 'gcc.dg/pr114768.c' for nvptx target [PR114768] Follow-up to commit 9f295847a9c32081bdd0fe908ffba58e830a24fb "rtlanal: Fix set_noop_p for volatile loads or stores [PR114768]": nvptx does behave in the exactly same way as expected; see 'diff' of before vs. after the 'gcc/rtlanal.cc' code changes: PASS: gcc.dg/pr114768.c (test for excess errors) [-FAIL:-]{+PASS:+} gcc.dg/pr114768.c scan-rtl-dump final "\\(mem/v:" --- 0/pr114768.c.347r.final 2024-04-19 11:34:34.577037596 +0200 +++ ./pr114768.c.347r.final 2024-04-19 12:08:00.118312524 +0200 @@ -13,15 +13,27 @@ ;; entry block defs 1 [%stack] 2 [%frame] 3 [%args] ;; exit block uses 1 [%stack] 2 [%frame] ;; regs ever live -;; ref usage r1={1d,2u} r2={1d,2u} r3={1d,1u} -;; total ref usage 8{3d,5u,0e} in 1{1 regular + 0 call} insns. +;; ref usage r1={1d,3u} r2={1d,3u} r3={1d,2u} r22={1d,1u} r23={1d,2u} +;; total ref usage 16{5d,11u,0e} in 4{4 regular + 0 call} insns. (note 1 0 4 NOTE_INSN_DELETED) (note 4 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) -(note 2 4 3 2 NOTE_INSN_DELETED) +(insn 2 4 3 2 (set (reg/v/f:DI 23 [ p ]) + (unspec:DI [ + (const_int 0 [0]) + ] UNSPEC_ARG_REG)) "source-gcc/gcc/testsuite/gcc.dg/pr114768.c":8:1 14 {load_arg_regdi} + (nil)) (note 3 2 6 2 NOTE_INSN_FUNCTION_BEG) -(note 6 3 10 2 NOTE_INSN_DELETED) -(note 10 6 11 2 NOTE_INSN_EPILOGUE_BEG) -(jump_insn 11 10 12 2 (return) "source-gcc/gcc/testsuite/gcc.dg/pr114768.c":10:1 289 {return} +(insn 6 3 7 2 (set (reg:SI 22 [ _1 ]) + (mem/v:SI (reg/v/f:DI 23 [ p ]) [1 MEM[(volatile int *)p_3(D)]+0 S4 A32])) "source-gcc/gcc/testsuite/gcc.dg/pr114768.c":9:8 6 {*movsi_insn} + (nil)) +(insn 7 6 10 2 (set (mem:SI (reg/v/f:DI 23 [ p ]) [1 *p_3(D)+0 S4 A32]) + (reg:SI 22 [ _1 ])) "source-gcc/gcc/testsuite/gcc.dg/pr114768.c":9:6 6 {*movsi_insn} + (expr_list:REG_DEAD (reg/v/f:DI 23 [ p ]) + (expr_list:REG_DEAD (reg:SI 22 [ _1 ]) + (nil)))) +(note 10 7 13 2 NOTE_INSN_EPILOGUE_BEG) +(note 13 10 11 3 [bb 3] NOTE_INSN_BASIC_BLOCK) +(jump_insn 11 13 12 3 (return) "source-gcc/gcc/testsuite/gcc.dg/pr114768.c":10:1 289 {return} (nil) -> return) (barrier 12 11 0) --- 0/pr114768.s 2024-04-19 11:34:34.577037596 +0200 +++ ./pr114768.s 2024-04-19 12:08:00.118312524 +0200 @@ -13,5 +13,10 @@ { .reg.u64 %ar0; ld.param.u64 %ar0, [%in_ar0]; + .reg.u32 %r22; + .reg.u64 %r23; + mov.u64 %r23, %ar0; + ld.u32 %r22, [%r23]; + st.u32 [%r23], %r22; ret; } PR testsuite/114768 gcc/testsuite/ * gcc.dg/pr114768.c: Enable for nvptx target. --- gcc/testsuite/gcc.dg/pr114768.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/pr114768.c b/gcc/testsuite/gcc.dg/pr114768.c index 2075f0d6b82..ffe3b368638 100644 --- a/gcc/testsuite/gcc.dg/pr114768.c +++ b/gcc/testsuite/gcc.dg/pr114768.c @@ -1,7 +1,7 @@ /* PR rtl-optimization/114768 */ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-rtl-final" } */ -/* { dg-final { scan-rtl-dump "\\\(mem/v:" "final" { target { ! { nvptx*-*-* } } } } } */ +/* { dg-final { scan-rtl-dump "\\\(mem/v:" "final" } } */ void foo (int *p) -- 2.34.1