Message ID | 20240112180844.2005246-5-ewlu@rivosinc.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp350912dyc; Fri, 12 Jan 2024 10:10:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwcGniKLKqdoug0kcGKDIufnKNyqG2M6QrpF4bdgdg7QX1cwnzpFffITRVN9rf3aMuwC/f X-Received: by 2002:a05:622a:1310:b0:429:d19a:ff57 with SMTP id v16-20020a05622a131000b00429d19aff57mr1072603qtk.112.1705083027282; Fri, 12 Jan 2024 10:10:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705083027; cv=pass; d=google.com; s=arc-20160816; b=i9q08SDiZalYLpP4FHO46rvHy+593OTJQ0/H6NyLbkoN6eD3TQ6Ruy1uebreVQT8s4 YRvJX5QQ3SfxV/PRF11MKFBYglP+lTcJzqKfp4Cqm2csxEFd6LPj2ApBI1/BOZLXUJd4 hlmhJqczyuL7pCIx+oInENyUD2HSwBRmKGBLhiOLK5lLwCQ2SJmiWojeuLPocqjrxFu2 KTNziCnJdoS/8HhxpESBmlibaAQFkFwC7f4QPFZudwIQc2B1DxlIpV/89PB5MJuv6Non dKwVUAxKYMFi9EIo0N8uVqTfoIA4LjqF8I2vc/NhQEG1b4GIKxfhTussaTTosf61qBLB +yLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=3/z5rPxUgdIaQHPDz+sQd164J4Kngqa/U2alNoHQB7c=; fh=r+SIYcgLopsTG8D0vSkuNNcbfbLGreWBAuINt5YEr6Q=; b=SuqsHyW+5QAttUh2i6ekzNAuJB+GHp+Bmynff1jKoax8tsCxpf9AjV3P7AEOhLQi3r KTywOUTMR6H/aolGD9OT+zfb6/atRFdW2GofcwpY5vbo2yqcgEI7FjyLVZF8anJ64ZE8 WaSrzq4CtGlnTgZMbgK4vV3AX1+JcD/b5w7h+cNf6xugpgWDxXhmQyik23S1CB+I9uBR aklUrxcBSloMtqm1H3s3SDhLnMSU2jGQHsUjFWz+EKQgnX4tOn5fc+TduPykq63ktkto HKiO9FFnVfJO9wdWZvpgYe1sC1IaYgJj5syk/RfR/z/q51GVDlqahwajNspPWlMOXoSM fyXg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=vrvNYg2U; 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" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a18-20020a05622a065200b00429d3c6e369si778784qtb.78.2024.01.12.10.10.27 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 10:10:27 -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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=vrvNYg2U; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 46BB7386102D for <ouuuleilei@gmail.com>; Fri, 12 Jan 2024 18:10:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id ECB2A385E82E for <gcc-patches@gcc.gnu.org>; Fri, 12 Jan 2024 18:09:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECB2A385E82E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ECB2A385E82E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::232 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705082944; cv=none; b=hykTwiiAU+3hb2z8W1j8t1qyhZlDxEnreGcP9ftMbbQkEL+XqXvFNgj7St9fmveM5+fV5eU5HpjFrcIFD3fj5pz0Uw4KOyCXP3SUmvgWBGLYj4p8tLXJhmtXJCIz+d5QOrPW9EaiBHVFf6Ea/QtEs2mB++Bg4gfvjbJ9Dfbxi+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705082944; c=relaxed/simple; bh=OHRFatTz7JtNa1aIVL9qAyf44l35F17JZ+nGYRSOXwo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=vURYTacWPGq126ecRnw6nQLzzJcHvTfigyEY62FoYU2migmOmtWKmRjHAoMVyi49deb3QoAEtLqfrmEjMCnjcc5Q3mDVM3SNwfjOQVpzUDFBjeaEgQ7jWBTZQ4rZulwifwBIlVj/pgaf3dcMnYOd46BrcoAFXXW8wGb9bBvC0VY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3bbbd4d2b4aso5695953b6e.0 for <gcc-patches@gcc.gnu.org>; Fri, 12 Jan 2024 10:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1705082942; x=1705687742; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3/z5rPxUgdIaQHPDz+sQd164J4Kngqa/U2alNoHQB7c=; b=vrvNYg2Ud2JRxAL/Zw6KC5MkvsrhPx5+h1xmtH0DaMCjxRU7lPaZjq4h9hsSW0yEwY QMq/dp7pHMtFrNv+/CFPOZryYWlJGCsfiWVaNgFRQXTvMZGRyaUNbyFiQg5jHtkp7GlY li0QXZlGAF+0XNhzwTXOseE1tjLik3xsvfBAaFWOpXcj4iRxTMaBJMsP6E9jZQK/zdUs h9s6FYhXrPgh6e1K+SjjN2zGatF7aqZR72Boj9pKvOIIucoAIfcxOTm+b34BixJzQJUW GWPLPmd8OkdVX88iy5HFbLBLHgUtPf6eSrM5oolrFWw7hB4BROs7h46l8uD4+tBjnQbk 4ctg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705082942; x=1705687742; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3/z5rPxUgdIaQHPDz+sQd164J4Kngqa/U2alNoHQB7c=; b=gnaO8zoSYaNQG83XwCzQwr8INgvhMrmCN1k41GrurpXCiP/KEnoIyYNGuyKh7T7GPA TfY48q6r1rxd3xpJ7ZkLTouZOfhq63Db67IHDyRlZdiaRwl9PsIVeAj0oZ8YejMAh+7E PEZieZ7m8+ovxaIjEz94pZxd0ak23Vw8nLY5bynWIZjOguWuvE2f/8pdHdU5Sl1mbt0u oM9YxRFt0j+Wz/lLJUi9dXB0rXlJA5h3C2jHD6+OS3QqYUpKxXlJN2D86jj5SyPXe07h IYS3kSEWsLo9LE7THippw4J480fkkKRhxpF6XS53QNmZLKD97tQrF0MwBO7vhJ1JIIf+ NLqw== X-Gm-Message-State: AOJu0Yy/rxwu3DQfW4vCS4db/uObatHIudnqtlUdzaJzDikALyHkIe5f lvt/5u44RRiiRgAQj18cTrPBWm1XzlZBHAmA5yBYpm9KNN4= X-Received: by 2002:a05:6808:2f0c:b0:3bd:42ed:5a30 with SMTP id gu12-20020a0568082f0c00b003bd42ed5a30mr2105156oib.29.1705082942307; Fri, 12 Jan 2024 10:09:02 -0800 (PST) Received: from ewlu.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id k14-20020a056808068e00b003bbea886e13sm660361oig.36.2024.01.12.10.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 10:09:01 -0800 (PST) From: Edwin Lu <ewlu@rivosinc.com> To: gcc-patches@gcc.gnu.org Cc: gnu-toolchain@rivosinc.com, Edwin Lu <ewlu@rivosinc.com> Subject: [PATCH V3 4/4] RISC-V: Enable assert for insn_has_dfa_reservation Date: Fri, 12 Jan 2024 10:08:43 -0800 Message-Id: <20240112180844.2005246-5-ewlu@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240112180844.2005246-1-ewlu@rivosinc.com> References: <20240112180844.2005246-1-ewlu@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787909140138198797 X-GMAIL-MSGID: 1787909140138198797 |
Series |
RISC-V: Associate typed insns to dfa reservation
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Edwin Lu
Jan. 12, 2024, 6:08 p.m. UTC
Enables assert that every typed instruction is associated with a
dfa reservation
gcc/ChangeLog:
* config/riscv/riscv.cc (riscv_sched_variable_issue): enable assert
Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
---
V2:
- No changes
V3:
- No changes
---
gcc/config/riscv/riscv.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Comments
> /* If we ever encounter an insn without an insn reservation, trip > an assert so we can find and fix this problem. */ > -#if 0 > + if (! insn_has_dfa_reservation_p (insn)) { > + print_rtl(stderr, insn); > + fprintf(stderr, "%d", get_attr_type (insn)); > + } > gcc_assert (insn_has_dfa_reservation_p (insn)); > -#endif > > return more - 1; > } I was thinking about make the gcc_assert a gcc_checking_assert so, in case we accidentally forget something at any point, it would only gracefully degrade in a release build. As we already have a hard assert for the type the patch (and not many test with enable checking anyway) this is OK IMHO. I suppose you tested with all available -mtune options? Regards Robin
On 1/25/2024 9:06 AM, Robin Dapp wrote: >> /* If we ever encounter an insn without an insn reservation, trip >> an assert so we can find and fix this problem. */ >> -#if 0 >> + if (! insn_has_dfa_reservation_p (insn)) { >> + print_rtl(stderr, insn); >> + fprintf(stderr, "%d", get_attr_type (insn)); >> + } >> gcc_assert (insn_has_dfa_reservation_p (insn)); >> -#endif >> >> return more - 1; >> } Oops accidentally left my debugging statements in the patch. > > I was thinking about make the gcc_assert a gcc_checking_assert so, > in case we accidentally forget something at any point, it would > only gracefully degrade in a release build. As we already have > a hard assert for the type the patch (and not many test with > enable checking anyway) this is OK IMHO. > > I suppose you tested with all available -mtune options? I ran the testsuite on all three tunes using linux rv64gcv. generic-ooo had some bugs fixed while rocket and sifive-7-series had around 37 new scan dump failures which I think is to be expected. No ICE's from the hard gcc_assert on any of the tunes so I think it should be fine as is. Edwin
On 1/25/2024 9:06 AM, Robin Dapp wrote: >> /* If we ever encounter an insn without an insn reservation, trip >> an assert so we can find and fix this problem. */ >> -#if 0 >> + if (! insn_has_dfa_reservation_p (insn)) { >> + print_rtl(stderr, insn); >> + fprintf(stderr, "%d", get_attr_type (insn)); >> + } >> gcc_assert (insn_has_dfa_reservation_p (insn)); >> -#endif >> >> return more - 1; >> } > > I was thinking about make the gcc_assert a gcc_checking_assert so, > in case we accidentally forget something at any point, it would > only gracefully degrade in a release build. As we already have > a hard assert for the type the patch (and not many test with > enable checking anyway) this is OK IMHO. > > I suppose you tested with all available -mtune options? > > Regards > Robin > > Committed without the debugging stuff! Edwin
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index ee1a57b321d..c428d3e4e58 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -8215,9 +8215,11 @@ riscv_sched_variable_issue (FILE *, int, rtx_insn *insn, int more) /* If we ever encounter an insn without an insn reservation, trip an assert so we can find and fix this problem. */ -#if 0 + if (! insn_has_dfa_reservation_p (insn)) { + print_rtl(stderr, insn); + fprintf(stderr, "%d", get_attr_type (insn)); + } gcc_assert (insn_has_dfa_reservation_p (insn)); -#endif return more - 1; }