From patchwork Fri Sep 2 14:36:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 57283 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 B6D923858036 for ; Fri, 2 Sep 2022 14:37:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6D923858036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662129435; bh=4DzCGPDN2O5FGcW3AC+HECuIxIplbU+AdhKyWIE9eqQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=VOaA7HT0rb9DvrOnjlBK5uLUZe9xSfcKe//OHxGMHl5tMt1TLIgcp5ugbqbz4q/3k s/hH+02i8Amz/TW0Ep6wXW6595fFevBtn4wa+g53cH6QBDvF1Y7O4mpZc6SNrzMAdy HHVqw/Kr0BgIhELV2aqdFyAp3uL8kqvU86Ib6QLo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 40CE63858C54 for ; Fri, 2 Sep 2022 14:36:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 40CE63858C54 Received: by mail-pg1-x52b.google.com with SMTP id 73so2158445pga.1 for ; Fri, 02 Sep 2022 07:36:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date; bh=4DzCGPDN2O5FGcW3AC+HECuIxIplbU+AdhKyWIE9eqQ=; b=rjv1VyxkUw2x7tCYOMl9/mGpfbY/rUUlMFRjzjhXQuSRvtAQ+miTEypTGHZtxsuw/9 purU4gsJEQm4RrQVEmxWX5elTUANH7G8pd5lYEdvnsmg3gW9ycCgWjEjodKPdZWFKPDF 6S1oICIO70C9M5wj2HJRWlftA0JnBeLX9SZ7NsejASOGMKBiWp+ukzn53PdWvc9XmxfF pBzDdebBfPl+fYNVAnnFZKxZjJiXUIyvLFjH2Hdb/kO5KzqJC8mEcEThSiIi2JXNBIbh cyvDu3pr1oJ4IMzpHhnabqXJbTtZWc4ggYtSMcgxJ6NH1MjIfwFdtBcQjFQ2cB+ET64+ l4gA== X-Gm-Message-State: ACgBeo11FPvQN+6mfa672J43u2cXReWUguuZhicWpAq9ANzZfhxLL4Mu weokmBfQVHJtXsl2KawV8Nm/BdMeHYU= X-Google-Smtp-Source: AA6agR65MvxkZ0ZzBA5/5bVaf1b2zZbVyxoQg//WMAfoag5Dazfjidegx3TP2IfFJkzLqu1QYh1kSg== X-Received: by 2002:a65:5b05:0:b0:42b:310c:1544 with SMTP id y5-20020a655b05000000b0042b310c1544mr31409581pgq.191.1662129401857; Fri, 02 Sep 2022 07:36:41 -0700 (PDT) Received: from gnu-tgl-3.localdomain ([172.56.31.255]) by smtp.gmail.com with ESMTPSA id p3-20020aa79e83000000b005371689d70fsm1863950pfq.120.2022.09.02.07.36.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 07:36:41 -0700 (PDT) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id C55B4C023F for ; Fri, 2 Sep 2022 07:36:39 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Ignore debug insns with CONCAT and CONCATN for insn scheduling Date: Fri, 2 Sep 2022 07:36:39 -0700 Message-Id: <20220902143639.2464892-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Spam-Status: No, score=-3026.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SCC_5_SHORT_WORD_LINES, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" CONCAT and CONCATN never appear in the insn chain. They are only used in debug insn. Ignore debug insns with CONCAT and CONCATN for insn scheduling to avoid different insn orders with and without debug insn. gcc/ PR rtl-optimization/106746 * sched-deps.cc (sched_analyze_2): Ignore debug insns with CONCAT and CONCATN. gcc/testsuite/ PR rtl-optimization/106746 * gcc.dg/pr106746.c: New test. --- gcc/sched-deps.cc | 14 ++++++++++++++ gcc/testsuite/gcc.dg/pr106746.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr106746.c diff --git a/gcc/sched-deps.cc b/gcc/sched-deps.cc index 948aa0c3b60..b472e4fbb09 100644 --- a/gcc/sched-deps.cc +++ b/gcc/sched-deps.cc @@ -2794,6 +2794,20 @@ sched_analyze_2 (class deps_desc *deps, rtx x, rtx_insn *insn) return; + case VAR_LOCATION: + if (GET_CODE (PAT_VAR_LOCATION_LOC (x)) == CONCAT + || GET_CODE (PAT_VAR_LOCATION_LOC (x)) == CONCATN) + { + /* CONCAT and CONCATN never appear in the insn chain. They + are only used in debug insn. Ignore insns with CONCAT and + CONCATN for insn scheduling to avoid different insn orders + with and without debug insn. */ + if (cslr_p && sched_deps_info->finish_rhs) + sched_deps_info->finish_rhs (); + return; + } + break; + default: break; } diff --git a/gcc/testsuite/gcc.dg/pr106746.c b/gcc/testsuite/gcc.dg/pr106746.c new file mode 100644 index 00000000000..1fc29de28c3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr106746.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-Wno-psabi -O2 -fsched2-use-superblocks -fcompare-debug" } */ +typedef char __attribute__((__vector_size__ (64))) U; +typedef short __attribute__((__vector_size__ (64))) V; +typedef int __attribute__((__vector_size__ (64))) W; + +char c; +U a; +U *r; +W foo0_v512u32_0; + +void +foo (W) +{ + U u; + V v; + W w = __builtin_shuffle (foo0_v512u32_0, foo0_v512u32_0); + u = __builtin_shufflevector (a, u, 3, 0, 4, 9, 9, 6, + 7, 8, 5, 0, 6, 1, 8, 1, + 2, 8, 6, 1, 8, 4, 9, 3, + 8, 4, 6, 0, 9, 0, 1, 8, + 2, 3, 3, 0, 4, 9, 9, 6, + 7, 8, 5, 0, 6, 1, 8, 1, + 2, 8, 6, 1, 8, 4, 9, 3, + 8, 4, 6, 0, 9, 0, 1, 8, + 2, 3); + v *= c; + w &= c; + *r = (U) v + (U) w; +}