From patchwork Thu Mar 9 10:37:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 66755 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp214760wrd; Thu, 9 Mar 2023 02:38:40 -0800 (PST) X-Google-Smtp-Source: AK7set9XYB48DAH3m40wNlJkC5xOna9URpeBi+81fxL68xy1ug0FsSZawIc35PxE2PaJaCHvF66n X-Received: by 2002:a05:6402:6cc:b0:4af:7dff:7b8d with SMTP id n12-20020a05640206cc00b004af7dff7b8dmr19687387edy.17.1678358320745; Thu, 09 Mar 2023 02:38:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678358320; cv=none; d=google.com; s=arc-20160816; b=i6tSMus3nMs+tS+TiqKBc/ZJq4ViLtrci6cNYm8ZLaOwsp+Ez0XuBIFtAxuATSxXyI 3UYDJlnSIaJn29Yj0J6/5DF+fb6Fte0g0jBAvi3X7Kua1unkepJB+rQrDnMacuB2GHHD MPTxR3iXHBUHxjSG/VceXKHJt+/oA3bHDBPSSq7j2yTiFwa34jsLU39OJHrJ/3XSYxub OjkQjZCHfMipAzKAQvJfPLiwOb31YIcRZhAICTEcFw5+x5q7V8RW8UjKRQoDNNSxu4sX RpUe98SQKDZPou9kjTOuks+qj/8MI1KHAjmxCYvh/1pylYmemrKfHmCOKwg3CakumNpt Jrfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:sender:errors-to:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:user-agent:subject:cc:to:date:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=vvH2t67S9SE8AkWiS/s5oxnibAVnrRQ01m0m4uPzoUs=; b=tWXyMeAtG6EhToQe4hQne2hRzk0x1LYiCcZGX0AbJRpetNgWi02nwsOf4ydpaggVJC wnKd7DBY90AOKrtehKMjvs5XkaxTLEXwCn1S+d2RoeIVUx0VpmxZRbhmbPb0U/2dPg4+ NqDacSE2qID5otuTGy+kX4dzbOQmZyhIH0n3eCsYCe1n0GJR2U1nkukdibpNwQLso0wV 8SWSgJo9z0FViQoJELca5m7Ta3X+56JkrRd+xhTZBDXCWNqFbdGV+CPzcACfSCxlEVZP nWubIOK7ErL/VK5FB31wRXrr4geDK07RBDWr5cDS7MXe4oxkiAIJy/q//zUWZWEG7ht9 3mdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oXxy2WB7; 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 q18-20020aa7d452000000b004acbe83b837si3716020edr.213.2023.03.09.02.38.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 02:38:40 -0800 (PST) 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=oXxy2WB7; 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 D67683850868 for ; Thu, 9 Mar 2023 10:38:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D67683850868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678358301; bh=vvH2t67S9SE8AkWiS/s5oxnibAVnrRQ01m0m4uPzoUs=; h=Date:To:cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=oXxy2WB79djdZEX3g6OjCmKlPSYn2OHpLPpVeDF94Z6f0lhUrQvBWt/Gf3xNhjH+W MgVscoBx/TFOIRMmtTJcD35+t3YKUFqdFX+qlnXxb9REoiutJrfrxfXcK0UKs0n/CO FuHQIDa6SRmxt6KuW7ZWQGWH08gibJjSyGlkXhHg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id D62A73850427 for ; Thu, 9 Mar 2023 10:37:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D62A73850427 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 9BDAD21E25; Thu, 9 Mar 2023 10:37:13 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 715EB2C141; Thu, 9 Mar 2023 10:37:13 +0000 (UTC) Date: Thu, 9 Mar 2023 10:37:13 +0000 (UTC) To: gcc-patches@gcc.gnu.org cc: richard.sandiford@arm.com Subject: [PATCH] Avoid unnecessary epilogues from tree_unroll_loop User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, SPF_HELO_NONE, SPF_PASS, TXREP 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: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" Message-Id: <20230309103821.D67683850868@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759886254615235769?= X-GMAIL-MSGID: =?utf-8?q?1759886254615235769?= The following fixes the condition determining whether we need an epilogue. When r12-2429-g62acc72a957b56 introduced this check I didn't notice the odd condition on review. Richard - do you remember if this was on purpose? I've noticed the mismatch with gcc.dg/tree-ssa/predcom-1.c for example. Bootstrapped and tested on x86_64-unknown-linux-gnu, queued for stage1. Richard. * tree-ssa-loop-manip.cc (determine_exit_conditions): Fix no epilogue condition. --- gcc/tree-ssa-loop-manip.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-ssa-loop-manip.cc b/gcc/tree-ssa-loop-manip.cc index c804a7353d5..a52277abdbf 100644 --- a/gcc/tree-ssa-loop-manip.cc +++ b/gcc/tree-ssa-loop-manip.cc @@ -1010,7 +1010,7 @@ determine_exit_conditions (class loop *loop, class tree_niter_desc *desc, /* Convert the latch count to an iteration count. */ tree niter = fold_build2 (PLUS_EXPR, type, desc->niter, build_one_cst (type)); - if (multiple_of_p (type, niter, bigstep)) + if (multiple_of_p (type, niter, build_int_cst (type, factor))) return; }