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: 933 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp763025wro; Fri, 2 Sep 2022 07:37:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6BknvwgUosMPSrGdVlOEwpemb065AGTK18k4tMdyW1ctTUHEb3YssgXwYdjYvChgY3O6LB X-Received: by 2002:a17:906:730d:b0:73d:c8a1:a8ee with SMTP id di13-20020a170906730d00b0073dc8a1a8eemr27909514ejc.661.1662129458896; Fri, 02 Sep 2022 07:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662129458; cv=none; d=google.com; s=arc-20160816; b=mNukx0ZorboI5PiQM9KCwoUlZyrbYqSRvv4PHcNYEMrSRN2QBy85cOiug60hkEpoxM 32gVGXI0l3EEdvuSx7mZAC102GcRp41H1Pv53YiC223if9/Y0WINzlgFzm0eQ0HwncCE WgpL9TCpVfRPW8xzkSz7DGBskMqtRF+xOMleeVhffJbK3hC5d/jwBFkJfFfaVXvw/TQb jsG9mSNSRq532jPK9BLk+QOntlJ2pq1UKv+URengfdV0WmMp4F4/k7CQjXtsRKPaKfIf o/jKMW9C49REpJcc3CxYZ9bZ1d8dsVfosVTd7Qv1BhqDKA6C1XABcTPa9x5q+cj5IbtE L1tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=4DzCGPDN2O5FGcW3AC+HECuIxIplbU+AdhKyWIE9eqQ=; b=XSsTdGFhTCvlJynHgVf2LrwCs8WyP3Zza1Rvh7LcUBQmyFwtX8BphYdYL/rCL6VOXJ z+Qr7jXz6HAq77Dz9utqk5/9+NFDC9J8wuBxPy/8j+HqAnUNr8szEj5ezj0H2ssn+K2N UnDcXDdsbwbhL2FIn9jGY3RQvTLUy/mLJBX1q4GiOLAELVU1/dlgQ3y86jgQ8i4Ko4FH hx+mS9LF5oJbbTaGA8EpKdyBZAaIZDWh6xItsZSCkY9obvwVT7ibDr804VeUSTDP2aR7 9r/ejuSz8uUfi9k+ub2MxMLn2CbIPLrz9CNmSAkNdq1dOduN1Xz2+FMcZh2b8Ut/SXDh ZMMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=K3hwQyQj; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id j9-20020a05640211c900b00447c699b7f2si408020edw.409.2022.09.02.07.37.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 07:37:38 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=K3hwQyQj; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68AAD3858C54 for ; Fri, 2 Sep 2022 14:37:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68AAD3858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662129450; 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=K3hwQyQjXT2tck5IIc3PclfBZGE9t1VyxG3tIpx6lyMKTLj6aq+XQaZrApQd7/ndf yiAYhGb2NZBrkYB6vYbi+vxywLxIu0Iwi1yj9dJZxq6Zxqjbb1+b4yHx6TWuaHK+/i ZhKATpftjJwMMmNuxpJTE61bEzSSc2Iy7gtAP79M= 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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742869059403949550?= X-GMAIL-MSGID: =?utf-8?q?1742869059403949550?= 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; +}