Message ID | 20230525083231.234-1-jinma@linux.alibaba.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp206661vqr; Thu, 25 May 2023 01:35:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7P88ubDb5VNr24XG8Vh5DLT0BdFDfiI2IIC+NO5evzrMdXoMJWoMiZN4MSiUmgmfw/p72S X-Received: by 2002:a17:906:d555:b0:965:6199:cf60 with SMTP id cr21-20020a170906d55500b009656199cf60mr1088145ejc.42.1685003720678; Thu, 25 May 2023 01:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685003720; cv=none; d=google.com; s=arc-20160816; b=g99UBI5ktz39nTcix2Ji/yVq0xgtZNnnnj45b+9o0U3wrDL0KDcec/iQFHBIEfuGcW D52RyazyxfTb+1zbI/NM5HCbyoRb6MVkgcFpaCBunEZjIr9C+h12gR3I+vRyvzQzQBkV 1GTkhreITCuhaNqoHU2jcgyyEF9qJ9sa6VzEsROICmSubK6OjrvfX+xs1CZZ7up36y9M lkX7ZAm6EWJb7lkQE6vSg1SW/tnFicrPmzgkvu51nDkWIrY0y5J1jACgyMI85jgyxfNI +g+fxm+lGdgQzwXWr3EnFBYbqrrUCqLzyrI5qQAYDLzOJDLnB8vDnHnx5gT9jJaiHolU kELQ== 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:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=HPRau6ejrJK/kFj/TO+aFiFJ/XM4kak9KlhDM8ogF40=; b=KgL3VPTt361rtFqflsSZR6nzGLcj/AFkTLSa2JrBj1+GZbPHgbRW3GQf0HtDXTnzae TeS+cZlYuPHEiadjwRDTHYbvtSn/yvEdQ3UILV57rLtEgavekyKpalRcSM0fkFn/AJ// XB5sWPK+5qm4G8xtJCfnRRAuybByNRM9S9UXMh86Fw06w1P0itRAERmK5AHbItSf+4rJ xXvLuamnouHIbVajBVHz8+Wi3Qq9ikiI8QSJJ8KfJDFC2URf8NSKYQCmOIzkxzFASzWh WuRrJynJB4GCqH4cy3LJ62HFrkkd1xG9NJ/8Xuv9OOmj6njjEK89hZ69vAgdV+JIvUWX Xigg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=O+VcOEeT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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. [8.43.85.97]) by mx.google.com with ESMTPS id q17-20020a1709060e5100b0094f17381000si699489eji.811.2023.05.25.01.35.20 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:35:20 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=O+VcOEeT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 75EF0385841C for <ouuuleilei@gmail.com>; Thu, 25 May 2023 08:33:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75EF0385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685003638; bh=HPRau6ejrJK/kFj/TO+aFiFJ/XM4kak9KlhDM8ogF40=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=O+VcOEeTkibSsTia245mQP2fTpKQyxuInKfMtvthXnGvgCzw5GYwozjOLOVlHLmgm g6LFXEZJDD/if+5Qg+dxjPERobqtJHtifV294lOFKdFXb3rxou/8vjA0ifaFFunUuw rJoDPCGKHBE6s4XYszZ0av4Esvf8xuwB8FIrBxkw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by sourceware.org (Postfix) with ESMTPS id 23C423858CDB for <gcc-patches@gcc.gnu.org>; Thu, 25 May 2023 08:32:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 23C423858CDB X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R541e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018045168; MF=jinma@linux.alibaba.com; NM=1; PH=DS; RN=7; SR=0; TI=SMTPD_---0VjRUzL0_1685003562; Received: from localhost.localdomain(mailfrom:jinma@linux.alibaba.com fp:SMTPD_---0VjRUzL0_1685003562) by smtp.aliyun-inc.com; Thu, 25 May 2023 16:32:44 +0800 To: gcc-patches@gcc.gnu.org Cc: jeffreyalaw@gmail.com, richard.sandiford@arm.com, kito.cheng@gmail.com, christoph.muellner@vrull.eu, jinma.contrib@gmail.com, Jin Ma <jinma@linux.alibaba.com> Subject: [PATCH] RISC-V: In pipeline scheduling, insns should not be fusion in different BB blocks. Date: Thu, 25 May 2023 16:32:31 +0800 Message-Id: <20230525083231.234-1-jinma@linux.alibaba.com> X-Mailer: git-send-email 2.38.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-20.6 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL 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 <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> From: Jin Ma via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jin Ma <jinma@linux.alibaba.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766854461325254525?= X-GMAIL-MSGID: =?utf-8?q?1766854461325254525?= |
Series |
RISC-V: In pipeline scheduling, insns should not be fusion in different BB blocks.
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Jin Ma
May 25, 2023, 8:32 a.m. UTC
When the last insn1 of BB1 and the first insn2 of BB2 are fusion, insn2 will clear all dependencies in the function chain_to_prev_insn, resulting in insn2 may mov to any BB, and the program calculation result is wrong. gcc/ChangeLog: * sched-deps.cc (sched_macro_fuse_insns): Insns should not be fusion in different BB blocks --- gcc/sched-deps.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Jin Ma <jinma@linux.alibaba.com> writes: > When the last insn1 of BB1 and the first insn2 of BB2 are fusion, insn2 will > clear all dependencies in the function chain_to_prev_insn, resulting in insn2 > may mov to any BB, and the program calculation result is wrong. > > gcc/ChangeLog: > > * sched-deps.cc (sched_macro_fuse_insns): Insns should not be fusion > in different BB blocks > --- > gcc/sched-deps.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/sched-deps.cc b/gcc/sched-deps.cc > index 2aa6623ad2e..998fe930804 100644 > --- a/gcc/sched-deps.cc > +++ b/gcc/sched-deps.cc > @@ -2833,7 +2833,7 @@ sched_macro_fuse_insns (rtx_insn *insn) > compile time complexity. */ > if (DEBUG_INSN_P (insn)) > return; > - prev = prev_nonnote_nondebug_insn (insn); > + prev = prev_nonnote_nondebug_insn_bb (insn); > if (!prev) > return; Huh, kind-of impressed we managed to go so long without hitting this. The patch is OK, thanks (and for branches too if necessary). Richard
On 5/25/23 03:22, Richard Sandiford wrote: > Jin Ma <jinma@linux.alibaba.com> writes: >> When the last insn1 of BB1 and the first insn2 of BB2 are fusion, insn2 will >> clear all dependencies in the function chain_to_prev_insn, resulting in insn2 >> may mov to any BB, and the program calculation result is wrong. >> >> gcc/ChangeLog: >> >> * sched-deps.cc (sched_macro_fuse_insns): Insns should not be fusion >> in different BB blocks >> --- >> gcc/sched-deps.cc | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/gcc/sched-deps.cc b/gcc/sched-deps.cc >> index 2aa6623ad2e..998fe930804 100644 >> --- a/gcc/sched-deps.cc >> +++ b/gcc/sched-deps.cc >> @@ -2833,7 +2833,7 @@ sched_macro_fuse_insns (rtx_insn *insn) >> compile time complexity. */ >> if (DEBUG_INSN_P (insn)) >> return; >> - prev = prev_nonnote_nondebug_insn (insn); >> + prev = prev_nonnote_nondebug_insn_bb (insn); >> if (!prev) >> return; > > Huh, kind-of impressed we managed to go so long without hitting this. Yea. I suspect a lot of the fusion cases we've handled until now have been more focused on things like compare+branch on x86 which are going to be in the same block. > > The patch is OK, thanks (and for branches too if necessary). I don't think Jin has commit privs, so I'll push it to the trunk and active release branches. jeff
On 5/25/23 02:32, Jin Ma wrote: > When the last insn1 of BB1 and the first insn2 of BB2 are fusion, insn2 will > clear all dependencies in the function chain_to_prev_insn, resulting in insn2 > may mov to any BB, and the program calculation result is wrong. > > gcc/ChangeLog: > > * sched-deps.cc (sched_macro_fuse_insns): Insns should not be fusion > in different BB blocks I've pushed this to the trunk. After a week or so I'll push it to the active release branches. jeff
diff --git a/gcc/sched-deps.cc b/gcc/sched-deps.cc index 2aa6623ad2e..998fe930804 100644 --- a/gcc/sched-deps.cc +++ b/gcc/sched-deps.cc @@ -2833,7 +2833,7 @@ sched_macro_fuse_insns (rtx_insn *insn) compile time complexity. */ if (DEBUG_INSN_P (insn)) return; - prev = prev_nonnote_nondebug_insn (insn); + prev = prev_nonnote_nondebug_insn_bb (insn); if (!prev) return;