From patchwork Wed Nov 1 18:17:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edwin Lu X-Patchwork-Id: 1858043 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=r5rP1ec3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SLFc06W2rz1yQ5 for ; Thu, 2 Nov 2023 05:17:52 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E07B53858C5E for ; Wed, 1 Nov 2023 18:17:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by sourceware.org (Postfix) with ESMTPS id 79BD73858D1E for ; Wed, 1 Nov 2023 18:17:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 79BD73858D1E 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 79BD73858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698862660; cv=none; b=EmsHA5Gv2oDjqGwrC7C7UIxT2Thd0X/AedPaQB9yG0fXs0G8/cpfX0yuJWzL1/gisKJ/dWWB7pV+7mtNRPg80nlEyAQLxY1uEvPi3HcVbXZbJtUqzS5C+3Z11uRyuezwVzbjI+njQUlfI3iBLGHkqk9prZu3myz+WOgRTwvNPXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698862660; c=relaxed/simple; bh=MTL/RBVMsQdUMELpOR1INSQQsk0c/xO9bkjhJj50Xqk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=DEJMQN8sz9KG+30/70uQ1Nt+bJiIIR0nIWCl7y9Opk2bPnBrB1BUhsq1R0TAUIXAzyZLRnWlbQTJPz+smQUE3ZKjyGu7TSL3NqPmjg4HCu8slLKEcvYo9fVrh5B2egnVF4Ak9yreenc/ZVXbSmlK61h6oNbUNTY7eMbaOG5Kd1U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-1ea82246069so67374fac.3 for ; Wed, 01 Nov 2023 11:17:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1698862649; x=1699467449; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Z5hMQz7yJbu1N0l08t2eRrfYO10BA4tjudW4iMg4kFU=; b=r5rP1ec3lOEFMU4BjQ6MwDLwWcWz/Rq3Jvvl8krBZzTyyWatvWmhJ2fzr1n/PWc/ke uryVxB8Y9U7YrCmhTphOGv4tRFgb57xZrBTKxcRmJL1wO6cD3JtHnaNTMQuyU5OwvEYm zEKiP0D6D9Sa+Uor12mKSNawNfz1PJhBH0G4XMURh5eFNXODdCwWadngKhBd8MoGs8us OZ5TZufV3D7UYQNmiVrPZNTwqVOoQq0gwKYi+cOjiFfilu9p8XntlKnzq+VofUAfd1fw OoJXaK4Jr5UFL3tGKOdGrQfkUfaaDwv533W8qQUm/fY5QZrJwQPdL6EynvLcrfMAxuSJ qscw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698862649; x=1699467449; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Z5hMQz7yJbu1N0l08t2eRrfYO10BA4tjudW4iMg4kFU=; b=td3iM+jr/eONf7Cu80Nz+4Emzv1Bf94ncgKaeENCOCejdzZn4oDbwOk+w9423pSCGM 0t7lR1PKxRfPji29JeoGnXPO1s92aEPqGmdPEO3sk3mrwi9VOseQjQ0YWt28Is42tXuV 6ZqxucblRr5K6y1V3E41fii/3Lq/IDg1sXdI6KQW4QXbot2YHspX7/ep36e4d/6H+0B0 fFM64nEJwUOBYHa5sd2jE3c0ea5dK6UVAsaMXUjtFdKzzoS7rRJah3a4K7aQST7GspLA zUA00Vrp5lzfuCHyBDDkuUCNzYhTTtsO+FGIusjUqDm52SSrzZUQ5ECGZM55GhuFcpdD 6Jfg== X-Gm-Message-State: AOJu0Yxw3H6k4a10La/4w4l3e5GFb1QdRHXQao83VCml+YQtTsBHzcqQ Y2xLyW82Yp45oJrmR0SREwKrFAKGze8b9nZjkjw= X-Google-Smtp-Source: AGHT+IENpumCuPHNNtVg5LJP9yN/rQ0lhLhwu3cC7S99iB69usJnsuHXR07vHlaLHTWwKn9W/C2z8A== X-Received: by 2002:a05:6870:a9a1:b0:1e9:e605:279f with SMTP id ep33-20020a056870a9a100b001e9e605279fmr22533527oab.13.1698862649563; Wed, 01 Nov 2023 11:17:29 -0700 (PDT) Received: from ewlu.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id s3-20020a05687087c300b001ea4324364csm311819oam.12.2023.11.01.11.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 11:17:29 -0700 (PDT) From: Edwin Lu To: gcc-patches@gcc.gnu.org Cc: gnu-toolchain@rivosinc.com, Edwin Lu Subject: [PATCH] RISC-V: Add check for types without insn reservations Date: Wed, 1 Nov 2023 11:17:13 -0700 Message-Id: <20231101181713.54765-1-ewlu@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Now that all insns are guaranteed to have a type, ensure every insn is associated with a cpu unit/insn reservation. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_sched_variable_issue): add disabled assert Signed-off-by: Edwin Lu --- gcc/config/riscv/riscv.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 0148a4f2e43..0bfd06902e5 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -7751,6 +7751,12 @@ riscv_sched_variable_issue (FILE *, int, rtx_insn *insn, int more) an assert so we can find and fix this problem. */ gcc_assert (get_attr_type (insn) != TYPE_UNKNOWN); + /* If we ever encounter an insn without an insn reservation, trip + an assert so we can find and fix this problem. */ +#if 0 + gcc_assert (insn_has_dfa_reservation_p (insn)); +#endif + return more - 1; }