From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id CCB073858D1E for ; Fri, 17 Nov 2023 12:55:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CCB073858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ispras.ru ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CCB073858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=83.149.199.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700225733; cv=none; b=VfXGOrbmPyNX2rijizUupYkbqZUAkWgXOxZkxEO5rYXaul04kpEfXsXFdfg2N7BnxbEI3RWQ1tpcNMRdoaW3PSHknzpA8efBh8R6OOzV0UaQpg7Fs07N2/U6FRoYo+Q1MyWYZvoDzwLk6gVd+OnRBEmDPdneNOxNM5JffOx3aBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700225733; c=relaxed/simple; bh=fDv8n1Poarj/35xZ3rcBHNMI7PsanC58IX5ZMXayzBU=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=qatfQR57G/K/c8B7FloyUNbfJgio1ACLrGULFWWmttH5DiODgRuM3fOgs/aSrJF4WLCTG/9uM6zj3GA9f86FFYYJN8UsAGW3cGLgD7RoBWcLcHi757ldSy46e9QLzysptXeS5QomTxBXU9dI31JM205vYFO1t/MobQa05pLUC4E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.10.3.121] (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id 37AB440762DD; Fri, 17 Nov 2023 12:55:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 37AB440762DD Date: Fri, 17 Nov 2023 15:55:30 +0300 (MSK) From: Alexander Monakov To: "Kewen.Lin" cc: Richard Biener , Jeff Law , Maxim Kuvyrkov , GCC Patches , Richard Sandiford , Jeff Law , Vladimir Makarov , zhroma@ispras.ru, Andrey Belevantsev , Segher Boessenkool , Peter Bergner , Michael Meissner , Alexandre Oliva Subject: Re: PING^1 [PATCH v3] sched: Change no_real_insns_p to no_real_nondebug_insns_p [PR108273] In-Reply-To: <9874e072-747a-39e9-da5e-d88f77b275aa@linux.ibm.com> Message-ID: <434b7d49-808e-5254-b023-a7e1dad29f81@ispras.ru> References: <85b4098e-a72f-d013-ff17-8097971f71ba@linux.ibm.com> <09FEFDAE-698B-4B06-A896-8088B9B31539@linaro.org> <4675c26c-f230-b6d6-27c5-bc9f74736e38@linux.ibm.com> <41a4d065-c4b6-4a67-adf0-e84e942616c7@gmail.com> <93ce3468-a1ee-e77c-cbeb-a8c67a303bf9@ispras.ru> <7eb725d9-de7c-87ba-5ebd-f2e1485c5854@ispras.ru> <475af219-f250-a0f4-78b0-998f96fb24aa@linux.ibm.com> <9874e072-747a-39e9-da5e-d88f77b275aa@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,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 List-Id: On Fri, 17 Nov 2023, Kewen.Lin wrote: > > I don't think you can run cleanup_cfg after sched_init. I would suggest > > to put it early in schedule_insns. > > Thanks for the suggestion, I placed it at the beginning of haifa_sched_init > instead, since schedule_insns invokes haifa_sched_init, although the > calls rgn_setup_common_sched_info and rgn_setup_sched_infos are executed > ahead but they are all "setup" functions, shouldn't affect or be affected > by this placement. I was worried because sched_init invokes df_analyze, and I'm not sure if cfg_cleanup can invalidate it. > > I suspect this may be caused by invoking cleanup_cfg too late. > > By looking into some failures, I found that although cleanup_cfg is executed > there would be still some empty blocks left, by analyzing a few failures there > are at least such cases: > 1. empty function body > 2. block holding a label for return. > 3. block without any successor. > 4. block which becomes empty after scheduling some other block. > 5. block which looks mergeable with its always successor but left. > ... > > For 1,2, there is one single successor EXIT block, I think they don't affect > state transition, for 3, it's the same. For 4, it depends on if we can have > the assumption this kind of empty block doesn't have the chance to have debug > insn (like associated debug insn should be moved along), I'm not sure. For 5, > a reduced test case is: Oh, I should have thought of cases like these, really sorry about the slip of attention, and thanks for showing a testcase for item 5. As Richard as saying in his response, cfg_cleanup cannot be a fix here. The thing to check would be changing no_real_insns_p to always return false, and see if the situation looks recoverable (if it breaks bootstrap, regtest statistics of a non-bootstrapped compiler are still informative). Alexander