From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 4ADB73858C41 for ; Wed, 15 Nov 2023 09:02:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4ADB73858C41 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4ADB73858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700038924; cv=none; b=XEDxFGqVDPn1OGbFM0qnwbkKh8pNMme1Tx/NigI3JLCZomh2ebM01U2DXQitm45RnAIJI2JFspPUxQnhPoxU0XU94uYThrEG1WQjIF6ZQZ6IF5Bg2gzVFQLJlndye/ngoKra3ZVQj68sfxgvWuokW5hxvmn5ieLcValYbTHRc9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700038924; c=relaxed/simple; bh=n/95pCaNcR5pyoYzEOmH/AHFJzh7wJHYYsS8qwoaC9k=; h=DKIM-Signature:Message-ID:Date:Subject:To:From:MIME-Version; b=fqPXIiS0O+otwdwHiLJylpJvINoHDA7dUp1ICQwCR2PZ4/6UEnJxvYKIzRDpiRitlnVnR4QNjY+jRrI0S/ULPnbv8TxC5PEwjdvS4ufe0pxNeizV+GmYXj1DkxqRhbCKC4ZoyW81IlnJBaRUE5D0MZKi2f1Qw3+dIpRDbIBaRFE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AF8goIm013158; Wed, 15 Nov 2023 09:01:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=bTMegY3ODDtaNTS88BgJc1uBeucVESyNzfI7F3WLF3s=; b=Fdn0T3neb2y8nWQT8ugnK1wMGn4sxERjuRW+aakfkYyP/S2JVOHGtooKbOxIxdMAKyUa eJz+ERqKs2UfODnZHcR7NnWdzewc107Im6Q9RSGyxVh9N+Ed38j6Nmmo4lR85i//Uten yY59jg/o/ndxqMsk3kgLj0qRFcT8JV6OrPIJwS3jj7VanOBgchv0BvX+LUf1gM5kwxfR scBYz5Emut2hGgLJIDNV5yAwo/7L6EqPkHhLLZTaOgx4FpljCurxs4F3O2enatua1+5A M2UB3ciROMdZ6Ilh3KPWsQ4jeHq3Y+HfgxJXgzBWrSSUL0TjppadT6jJUQS4lTLx3hX/ zw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uctq90hu3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 09:01:58 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AF8uulM005103; Wed, 15 Nov 2023 09:01:58 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uctq90htn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 09:01:58 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AF7ucts024350; Wed, 15 Nov 2023 09:01:56 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uamaye8n4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 09:01:56 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AF91rM765405380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Nov 2023 09:01:53 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 453D52004F; Wed, 15 Nov 2023 09:01:53 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E3A420040; Wed, 15 Nov 2023 09:01:48 +0000 (GMT) Received: from [9.177.82.153] (unknown [9.177.82.153]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Nov 2023 09:01:48 +0000 (GMT) Message-ID: Date: Wed, 15 Nov 2023 17:01:46 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: [PATCH] sched: Remove debug counter sched_block Content-Language: en-US To: Alexander Monakov , Maxim Kuvyrkov Cc: GCC Patches , Richard Guenther , Richard Sandiford , Jeff Law , Vladimir Makarov , zhroma@ispras.ru, Andrey Belevantsev , Segher Boessenkool , Peter Bergner , Michael Meissner References: <85b4098e-a72f-d013-ff17-8097971f71ba@linux.ibm.com> <09FEFDAE-698B-4B06-A896-8088B9B31539@linaro.org> From: "Kewen.Lin" In-Reply-To: Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: CZsA6gP4q9eHwGaNnpUSuq9LSip86u7c X-Proofpoint-GUID: BxGDgaeNLOT8Y9ixgHiVC-eSIK-GV7B3 Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-15_07,2023-11-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 impostorscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311150067 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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: Hi, on 2023/11/10 01:40, Alexander Monakov wrote: > I agree with the concern. I hoped that solving the problem by skipping the BB > like the (bit-rotted) debug code needs to would be a minor surgery. As things > look now, it may be better to remove the non-working sched_block debug counter > entirely and implement a good solution for the problem at hand. > According to this comment, I made and tested the below patch to remove the problematic debug counter: Subject: [PATCH] sched: Remove debug counter sched_block Currently the debug counter sched_block doesn't work well since we create dependencies for some insns and those dependencies are expected to be resolved during scheduling insns but they can get skipped once we are skipping some block while respecting sched_block debug counter. For example, for the below test case: -- int a, b, c, e, f; float d; void g () { float h, i[1]; for (; f;) if (c) { d *e; if (b) { float *j = i; j[0] = 0; } h = d; } if (h) a = i[0]; } -- ICE occurs with option "-O2 -fdbg-cnt=sched_block:1". As the discussion in [1], it seems that we think this debug counter is useless and can be removed. It's also implied that if it's useful and used often, the above issue should have been cared about and resolved earlier. So this patch is to remove this debug counter. Bootstrapped and regtested on x86_64-redhat-linux and powerpc64{,le}-linux-gnu. [1] https://gcc.gnu.org/pipermail/gcc-patches/2023-November/635852.html Is it ok for trunk? BR, Kewen ----- gcc/ChangeLog: * dbgcnt.def (sched_block): Remove. * sched-rgn.cc (schedule_region): Remove the support of debug count sched_block. --- gcc/dbgcnt.def | 1 - gcc/sched-rgn.cc | 19 ++++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def index 871cbf75d93..a8c4e61e13d 100644 --- a/gcc/dbgcnt.def +++ b/gcc/dbgcnt.def @@ -198,7 +198,6 @@ DEBUG_COUNTER (pre_insn) DEBUG_COUNTER (prefetch) DEBUG_COUNTER (registered_jump_thread) DEBUG_COUNTER (sched2_func) -DEBUG_COUNTER (sched_block) DEBUG_COUNTER (sched_breakdep) DEBUG_COUNTER (sched_func) DEBUG_COUNTER (sched_insn) diff --git a/gcc/sched-rgn.cc b/gcc/sched-rgn.cc index e5964f54ead..1c8acf5068a 100644 --- a/gcc/sched-rgn.cc +++ b/gcc/sched-rgn.cc @@ -3198,20 +3198,13 @@ schedule_region (int rgn) current_sched_info->queue_must_finish_empty = current_nr_blocks == 1; curr_bb = first_bb; - if (dbg_cnt (sched_block)) - { - int saved_last_basic_block = last_basic_block_for_fn (cfun); + int saved_last_basic_block = last_basic_block_for_fn (cfun); - schedule_block (&curr_bb, bb_state[first_bb->index]); - gcc_assert (EBB_FIRST_BB (bb) == first_bb); - sched_rgn_n_insns += sched_n_insns; - realloc_bb_state_array (saved_last_basic_block); - save_state_for_fallthru_edge (last_bb, curr_state); - } - else - { - sched_rgn_n_insns += rgn_n_insns; - } + schedule_block (&curr_bb, bb_state[first_bb->index]); + gcc_assert (EBB_FIRST_BB (bb) == first_bb); + sched_rgn_n_insns += sched_n_insns; + realloc_bb_state_array (saved_last_basic_block); + save_state_for_fallthru_edge (last_bb, curr_state); /* Clean up. */ if (current_nr_blocks > 1) -- 2.39.1