From patchwork Tue Oct 31 22:51:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edwin Lu X-Patchwork-Id: 1857779 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=CHcIKuAl; 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 4SKlks2jn6z1yQk for ; Wed, 1 Nov 2023 09:52:03 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF5173857B9B for ; Tue, 31 Oct 2023 22:52:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by sourceware.org (Postfix) with ESMTPS id 705CE3858D1E for ; Tue, 31 Oct 2023 22:51:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 705CE3858D1E 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 705CE3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::32 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698792711; cv=none; b=gUvb2BJpiFDKm4neZHcGf7BbTisM5QMCUhuk67yx3c7V7bfju7rIedWP+ChAgchzS5Xbt6gGcqYFKx1DlblFHNj1vDl0Ar7fZR2e176jE8tRZqRc1lZAR5fuAYCXgS6hRV8rP0OjBk+TSpgmQJdYImirtTd0LNYfUTUPnnVzmts= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698792711; c=relaxed/simple; bh=e6XTkyAi2R+p+x/oQsjF0M2AAaNhKPTZsPWL+ztXXik=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ScBn3ZrIfYKFUPnUuY6MAHruy19+P9mXSV7CFrRaDuqxXqNCUc2HEF7zF1rwkmslgaIqyqiiNMxTrZqxQM/TJJ4lGD7m7891wssOf7kmNvBm4JeJafe9VV00hSmGvPHcpKspMPOkIXsMLTIkHsTCG4jnxFGDXnUu/bL9SkxE6Fo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-1dc9c2b2b79so2810258fac.0 for ; Tue, 31 Oct 2023 15:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1698792708; x=1699397508; 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=OlRJlv7bQGYs2DhvY5fDOjiLLmfwynjgKy3pMoPfBUg=; b=CHcIKuAlGzIdEiXsFmv/d1v7CTVbge6OR8I5wE6YBZAkVnmxs37kyGyIi+dyfETiI8 +zc6tCSfk+yNi4TYzvfNCQkI3A5lhtxoFv13Ml0OaghF8iWOjpziuuiQaSUdD0zEJJt2 2FAx4E26FI+DNrt6kpegHUjm71bhksIZkbHmgDGAHYw6O+eHgAdqJZdLoVIEl7S5/9Yb FDTTFOI6g2MVol/p9oefzsthRs0n3gE2rGhQTvtvo877JK+Fon+jjsAxqm0+ZeRR7UB+ iFLDszUz6yoS/xzXHO+YVbqwDGEFTS8rK0U4Q2NkyYKEgdrN7p8E3zuTAkxvVF8Qk+7j pnIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698792708; x=1699397508; 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=OlRJlv7bQGYs2DhvY5fDOjiLLmfwynjgKy3pMoPfBUg=; b=odmziEarfzx9wmn1GnLvXUGen1BTqTHC2rNPhC6yP9CwlYbuBHBr3GXUG823uGcEEk 7lM5bNPkeOf3ce5jCndJODzRWWYhkz1QAamY8t9BerpQZfrPb/gp98VyTGdVY3oMeeRf evEWPHpmudAkwkSzIqba7sHDqb8RdQ28Aks+bUcQwK7nmva6FfYDIW45iTmtDLxA2DOf zMkjUR2xINGg4WcMggBW76Iwh5N0xXxa32WakvB6Zzo+9cWELy4qO06+Pfqsi3hLG1ll ZkKaF3qnmkaWQFoo056zECUCUazUA9t8i4YpyiiJjHtufZbpZlWfuiNyNqSDAOKtnFHn RjIw== X-Gm-Message-State: AOJu0YzUkZQzbTssN/sdQbN2Zv2FgzxeVMCSYDp1JylUfPQ14Aqr8Hts V/lYz4DmQnnydmrFZbA+PTJh5yjpUKGfoAOMK9E= X-Google-Smtp-Source: AGHT+IFEQXyiTu8GSsxMtAtmxbTIg+Vye+sC57lWd+7BHUrXPJO6NAYk3s3adjBwgjn8u0qTpco9hQ== X-Received: by 2002:a05:6870:1004:b0:1d5:b1c7:3617 with SMTP id 4-20020a056870100400b001d5b1c73617mr11013120oai.13.1698792708614; Tue, 31 Oct 2023 15:51:48 -0700 (PDT) Received: from ewlu.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id n6-20020a05687104c600b001eae28db525sm58487oai.23.2023.10.31.15.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 15:51:48 -0700 (PDT) From: Edwin Lu To: gcc-patches@gcc.gnu.org Cc: gnu-toolchain@rivosinc.com, jeffreyalaw@gmail.com, Edwin Lu Subject: [RFC] Make genautomata.cc output reflect insn-attr.h expectation: Date: Tue, 31 Oct 2023 15:51:44 -0700 Message-Id: <20231031225144.24448-1-ewlu@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 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 genattr.cc currently generates insn-attr.h with the following structure: #if CPU_UNITS_QUERY extern int get_cpu_unit_code (const char *); extern int cpu_unit_reservation_p (state_t, int); #endif extern bool insn_has_dfa_reservation_p (rtx_insn *); however genautomata.cc generates insn-automata.cc with the following structure: #if CPU_UNITS_QUERY int get_cpu_unit_code (const char * ) { ... } int cpu_unit_reservation_p (state_t, int) { ... } bool insn_has_dfa_reservation_p (rtx_insn *) { ... } #endif I'm not sure if insn_has_dfa_reservation_p is supposed to be a part of the CPU_UNITS_QUERY conditional group or not. For consistency, I would like to move it outside of the group. This would move insn_has_dfa_reservation_p out of the #if CPU_UNITS_QUERY conditional inside of insn-automata.cc. This would allow us to see if the scheduler is trying to schedule an insn with a type which is not associated with a cpu unit or insn reservation through the TARGET_SCHED_VARIABLE_ISSUE hook. If there is a reason for insn_has_dfa_reservation_p being within the conditional, please let me know! gcc/Changelog: * genautomata.cc (write_automata): move endif Signed-off-by: Edwin Lu --- gcc/genautomata.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/genautomata.cc b/gcc/genautomata.cc index 72f01686d6b..9dda25e5ba2 100644 --- a/gcc/genautomata.cc +++ b/gcc/genautomata.cc @@ -9503,9 +9503,9 @@ write_automata (void) fprintf (output_file, "\n#if %s\n\n", CPU_UNITS_QUERY_MACRO_NAME); output_get_cpu_unit_code_func (); output_cpu_unit_reservation_p (); - output_insn_has_dfa_reservation_p (); fprintf (output_file, "\n#endif /* #if %s */\n\n", CPU_UNITS_QUERY_MACRO_NAME); + output_insn_has_dfa_reservation_p (); output_dfa_clean_insn_cache_func (); output_dfa_start_func (); output_dfa_finish_func ();